作业帮 > 综合 > 作业

MATLAB怎么看程序运行了多少次呢?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/05 21:53:23
MATLAB怎么看程序运行了多少次呢?
%%ODE45_fun解方程
tspan=[0,1e-5];
x0=[2.1e+10,1,1,1,1];
[t,x]=ode45('ODE45_fun',tspan,x0);
a1=1;a2=1;e1=9;e2=7;f1=56;f2=98;g1=76;g2=665;
a=a1+a2;
e=e1+e2;
f=f1+f2;
g=g1+g2;
[n,m]=size(x);
for i=1:n
x(i,6)=x(i,4)*x(i,5)+x(i,2)*x(i,3)+e*f+e*g;
end
data=[t,x];
save ODE45_data.txt data -ascii
subplot(2,3,1),plot(t,x(1))
subplot(2,3,2),plot(t,x(2))
subplot(2,3,3),plot(t,x(3))
subplot(2,3,4),plot(t,x(4))
subplot(2,3,5),plot(t,x(5))
subplot(2,3,6),plot(t,x(6))
Warning: Failure at t=1.075809e-007. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed (2.117582e-022) at
time t.
> In ode45 at 355
打开你的主脚本文件,点击这个按钮,会生成你的代码运行报告,包括时间和调用次数。