Error assigning variable in loop
Show older comments
It is beyond me why I cannot figure this out. The debugger points to the line 'wsstd(i,1) = fricvelo.*4;' but I think it has to do with my if statement as even when the condition is failed, a calculation is still done. L(1,1) for instance is -0.393. I am sure my tired eyes just can't find the simple problem.
wsstd = zeros(length(ws),1);
for i = 1:11950;
if L(i,1) >= -500 && L(i,1) <= -50
wsstd(i,1) = fricvelo.*4;
else
wsstd(i,1) = 0;
end
end
2 Comments
Rick Rosson
on 13 Nov 2014
Edited: Rick Rosson
on 13 Nov 2014
- Please post the exact and complete error message.
- What is the result of typing size(fricvelo) at the command prompt?
mashtine
on 13 Nov 2014
Accepted Answer
More Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!