Hello, I have a FOR loop that makes a call for a custom simulink matlab function block I wrote every iteration. The function block has persistent variables that are supposed to remember their values from previous calls, however currently they don't. What do I do wrong?
Thats how the initialization looks (I don't use CLEAR in between the calls):
function[] = custom_func() persistent gen tstat hyst comps xvalve yvalve;if (isempty(gen)) [gen, tstat, hyst, comps, xvalve, yvalve]=data_locker();end
Best Answer