Hi there, I am using simple "for loop" (see below) in Simulink using Matlab function block. I code simply work in workspace without error. however does not work as Matlab function in Simulink block. Can anyone help me with this. Thanking you in advance,
function P = P(I, del_t)
for i=1:10000
capn = 20.6;
sigma = -0.14;
row = 0.6436;
soc(i+1) = soc(i) + (I*del_t)/((capn+sigma)+row);
end
P = SOC(i+1);
end
1 Comment
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/286817-matlab-funtion-using-for-loop-in-simulink#comment_843213
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/286817-matlab-funtion-using-for-loop-in-simulink#comment_843213
Sign in to comment.