用MATLAB编一个动画.

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/19 13:13:55
用MATLAB编一个动画.
xRn0~qr`^ q*7$=86DW$ ߡOPj8-Њx 8VBoof<3|?ys|^W'?? nRKE&AER@JvDryLiQxK'@GK(1CpY¤㕸g<LϔlY@DPCiSĄp<+ul~ zoW3Z}Ycl,O3mn]GgY@&CK\ nON(ejREp@VA5z Hy%C0FCʁЅEsSqkרջ0Τt[[h1%,4oG\$3mB/N9 ꃫ>nt͏4)LzuV_}{,7.Ya({Kqմ iA9/lk.]*pcYql=)ĘgN*r^/`+

用MATLAB编一个动画.
用MATLAB编一个动画.

用MATLAB编一个动画.
function y=sss()
a=0;b=pi;
dif=(temp(b)-temp(a))/(b-a);
x0=a:0.01:b;
y0=temp(x0);
widths=pi/4;
n=length(x0);
for i=1:n
x1=(x0(i)-widths):0.01:(x0(i)+widths);
dd=dtemp(x0(i));
y1=(x1-x0(i))*dd+y0(i);
plot(x0,y0,'-r');
hold on;
axis([0 pi 0 5]);
plot([a b],[temp(a),temp(b)],'-b');
plot(x1,y1,'-.k');
tutu = legend('f(x)=x+sin(x)','端点割线','切线');
set(tutu,'fontname','宋体','fontsize',10,'FontWeight','demi');
title('用函数f(x)=x+sin(x)验证Lagrange中值定理',...
'fontname','宋体','fontsize',9,'FontWeight','demi','Color','black');
plot(x0(i),y0(i),'-ro','markersize',4);
pause(0.001);
hold off;
if abs(dd-dif)