condition in a loop
1 次查看(过去 30 天)
显示 更早的评论
I have the loop as given below. But I need to restrict the value of b till 30, i.e. the value of b cannot exceed 30. 'a' value does not have a limit. I am not sure how to proceed.
a=0;
b=0;
g=a+b;
while g<100
a=a+1
b=b+1
g=a+b
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!