⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exm05122_1.m

📁 这是本人收集的一些程序源代码
💻 M
字号:
%exm05122_1.m
x=(0:0.1:1)*2*pi;y=sin(x);
pp=spline(x,y);
int_pp=fnint(pp);
der_pp=fnder(pp);
xx=(0:0.01:1)*2*pi;
err_yy=max(abs(ppval(pp,xx)-sin(xx)))
err_int=max(abs(ppval(int_pp,xx)-(1-cos(xx))))
err_der=max(abs(ppval(der_pp,xx)-cos(xx)))  
%(2)
DefiniteIntegral.bySpline=ppval(int_pp,[1,2])*[-1;1];		%	<2>
DefiniteIntegral.byTheory=(1-cos(2))-(1-cos(1));
Derivative.bySpline=fnval(der_pp,3);
Derivative.byTheory=cos(3);
Derivative.byDiference=(sin(3.01)-sin(3))/0.01;
DefiniteIntegral,Derivative  
%(3)
clf,shg
fnplt(pp,'b-');hold on
fnplt(int_pp,'m:'),fnplt(der_pp,'r--');hold off
legend('y(x)','S(x)','dy/dx')  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -