any single vector element =0 than loop again rotate and again loop start from first line
1 次查看(过去 30 天)
显示 更早的评论
30 element in vector check each value of vector and any element in vector =0 than loop again start from first step i want to go at first line of code if condition not satisfy , this vector is get after some process if any content is not zero than move forward and if any content is zero than again loop rotate
采纳的回答
Jan
2017-4-7
I'm not sure, if I understand the question correctly. A guess:
ready = false;
while ~ready
... your code
v = randi([-10, 10], 1, 30); % Pseudo-data, use your vector instead
if all(v) % Stop loop if v does not contain any 0
ready = true;
end
end
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!