以下是我写的3个m文件
文件1:function x=p(t)
if t==0
x=0.1;
else
x=p(t-1)+0.01*(Qd(t-1)-Qs(t-1));
end
end
文件2:function y=Qd(t)
if t==0
y=2;
else
y=10-1.5*p(t-1);
end
end
文件3:function z=Qs(t)
if t==0
z=1;
else
z=2+0.5*p(t-1);
end
end
求怎么画Qd-p(t)和Qs-p(t)图,直接输plot(p(t),Qd(t))报错如下
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.
Error in p
set(0,'RecursionLimit',2000)之类的又会导致matlab直接崩溃
以及如果用这三个m文件算诸如p(50)之类的会算的很慢,求问如何改进能减少其运算量。
非常感谢


雷达卡




京公网安备 11010802022788号







