手机兼职平台网站开发,科技部网站,品牌vi设计企业,企业信息网查询目录
指数函数及e
指数增长
复数指数
练习
1. expgui
2. 计算e
3 五角星绘制 指数函数及e #xff08;1#xff09;的比值总是常数 #xff08;2#xff09;的导数为其自身。#xff08;根据比值1推导出e的值#xff09; %% Plot a^t and its approximate derivat…目录
指数函数及e
指数增长
复数指数
练习
1. expgui
2. 计算e
3 五角星绘制 指数函数及e 1的比值总是常数 2的导数为其自身。根据比值1推导出e的值 %% Plot a^t and its approximate derivativea 2;t 0:.01:2;h .00001;y 2.^t;ydot (2.^(th) - 2.^t)/h;plot(t,[y; ydot])legend(y,dy/dx) %% Compute eformat longformat compacth 1;while h 2*epsh h/2;e (1 h)^(1/h);disp([h e])end 对指数函数进行二项式展开求和式的每一项都通过前一项简单计算得出。该循环在rs时结束即两个相连的部分浮点数相同时结束。 %% Experimental version of exp(t)t rands 1;term 1;n 0;r 0;while r ~ sr s;n n 1;term (t/n)*term;%求和式的每一项都通过前一项简单计算得出s s term;endexp_of_t s 指数增长 年利、月利、连续利息 %% Compound interestfprintf( t yearly monthly continuous\n)format bankr 0.05;y0 1000;for t 0:20y1 (1r)^t*y0;y2 (1r/12)^(12*t)*y0;y3 exp(r*t)*y0;disp([t y1 y2 y3])end 贷款清还 %% Payments for a car loany0 20000r .10h 1/12n 36p (1r*h)^n/((1r*h)^n-1)*r*h*y0 复数指数 绘制八边形 %% Complex exponentialtheta (1:2:17)*pi/8z exp(i*theta)p plot(z);set(p,linewidth,4,color,red)axis square off 练习 1. expgui 2. 计算e
%% 计算e
%在h很小时10的负多少次方不能由浮点数很好表示将会发生偏差
clear
format long
format compact
h1
while h1.e-15hh/10; e(1h)^(1/h); disp([h e])
end%% 计算e
clear
format long
format compact
h1
while h1.e-15hh/10; e(1h)^(1/(1h-1)); disp([h e])
end 3 五角星绘制
%% 利用复数指数绘制五角星theta (0:3:15)*(2*pi/5)z exp(i*theta)p plot(z);set(p,linewidth,4,color,red)axis square off