在Matlab下输入:edit,然后将下面两行百分号之间的内容,复制进去,保存
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function f=f31(x)
f=1./[(x-2).^2+0.1]+1./[(x-3).^4+0.01];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 返回matlab主界面
输入:
temp=[1,2,3;4,5,6];
f=f31(temp) %验证x是矩阵输入,程序能跑
x=0:0.01:4;
f=f31(x);
plot(x,f) 2题
在Matlab下输入:edit,然后将下面两行百分号之间的内容,复制进去,保存
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function dydx=zh_lankesterljy(x,y)
dydx=x.^2./y-x.*cos(y);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 在Matlab下面输入:
t_end=5;
y0=[1];
[x,y]=ode45('zh_lankesterljy',[0,t_end],y0);
plot(x,y);
xlabel('x');
ylabel('y');
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试