Say I want to repeat this user defined function within a loop with , how can I do it? Each time I do it like below I get this message – "Function definition is misplaced or improperly nested."
r=1; while(1) function y= myFunc (x) y= -(500000*r*x(1)); r=r+1; end if (r>10) break; endend
Best Answer