How to use not equal in for loop
显示 更早的评论
Is it possiable to use ~= in for loop like
for t ~= 1
xxx
xxx
xxx
end
回答(1 个)
James Tursa
2020-8-10
编辑:James Tursa
2020-8-10
You could use a while loop. E.g.,
t = 0;
while( t ~= 1 )
% code
% at some point, either set t=1 or break out of loop
end
类别
在 帮助中心 和 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!