文件名称:misc2
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:8.62kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
Simple exercise that calculate the Taylor expansion of the exponential
function.
Input variables: degree N
vector of evaluation points, x
At each step plots the Taylor polynomial and compare with the real
function
function y=taylor_exp(N,x)
printf("Order of the expansion: d ", N)
size(x)
y=ones(size(x))
plot(x,y,"r-",x,exp(x),"b-")
legend("n=0,exp(x)")
for n=1:N
y+=(1/factorial(n))*(x.^n)
plot(x,y,"r-",x,exp(x),"b-")
xlabel("x")
ylabel("f(x)")
legend("approx","exp(x)")
pause
end
endfunction
-
Simple exercise that calculate the Taylor expansion of the exponential
function.
Input variables: degree N
vector of evaluation points, x
At each step plots the Taylor polynomial and compare with the real
function
function y=taylor_exp(N,x)
printf("Order of the expansion: d ", N)
size(x)
y=ones(size(x))
plot(x,y,"r-",x,exp(x),"b-")
legend("n=0,exp(x)")
for n=1:N
y+=(1/factorial(n))*(x.^n)
plot(x,y,"r-",x,exp(x),"b-")
xlabel("x")
ylabel("f(x)")
legend("approx","exp(x)")
pause
end
endfunction
(系统自动生成,下载前可以参看下载内容)
下载文件列表
chis_rnd.m
GAMM_RND.M
HPDI.M
is_scalar.m
MOMENTG.M
NORM_CDF.M
norm_pdf.m
norm_rnd.m
STDN_CDF.M
stdn_pdf.m
tdens.m
tdis_rnd.m
truncnorm_rnd.m
GAMM_RND.M
HPDI.M
is_scalar.m
MOMENTG.M
NORM_CDF.M
norm_pdf.m
norm_rnd.m
STDN_CDF.M
stdn_pdf.m
tdens.m
tdis_rnd.m
truncnorm_rnd.m
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.