while lopps. help plz ´,
古いコメントを表示
Hi all. I am trying to make a while loops that will keep on running if the user input is a str, a number less and equal 0 or the number is longer the length of my vector. But it doesn't work, plz help:)
deleterowStr=input('Please enter the number of the row:','s');
deleterow=str2num(deleterowStr);
while ~((~isempty( deleterow) && deleterow <=0 || deleterow > length(W)) || strcmpi(deleterowStr,'')==1)
disp('Invaild row number')
deleterowstr=input('Please enter the number of the row:','s');
deleterow=str2num(deleterowstr);
end
thx:)
1 件のコメント
Joseph Cheng
2014 年 6 月 23 日
duplicate post http://www.mathworks.com/matlabcentral/answers/137126-problem-in-while-loop-when-input-is-characters-or-words
anyways. I would suggest put a break point in and see why you do not meet the criteria to breakout of the loop.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Parallel Computing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!