is 'continue' in 'c' language similar in MATLAB??
1 view (last 30 days)
Show older comments
i am changing my code of c language in to matlab .but its gives infinite loop in Matlab during use 'continue' statement?
what is the problem? is there any other alternate of 'continue' statement?
4 Comments
Accepted Answer
Friedrich
on 6 Apr 2013
Edited: Friedrich
on 6 Apr 2013
Hi,
yes continue in MATLAB is the same as in C. However when I look at that while loop:
while j<=n
if j==i
continue;
end
this can`t even work in C. If j == i you will hit an endless loop because j never changes. Maybe you are missing to increment j before the continue statement?
2 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!