您好,我想知道如何将输出变量的前一个值保存在matlab函数中。如何在Matlab函数中保存以前的变量值函数
function y = fcn(x,d,yp)
yp=0; %here I want to initialize this value just at the start of simulation
if (x-yp<=d)
y=x;
else
y=yp + d;
end
yp=y; % here i want to load output value
感谢您的帮助
谢谢你队友救了我的命! –