Getting user input until they select the right choice
    5 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I have a code which requires the user to select a point on a plot. If they select a point that is not on the plot then it will keep asking the user to click on another point. Is the a way to do this? or something similar that I could work with?
Thanks
0 件のコメント
回答 (1 件)
  per isakson
      
      
 2014 年 9 月 6 日
        
      編集済み: per isakson
      
      
 2014 年 9 月 6 日
  
      Start simple. Hint:
    x = inf;
    y = inf;
    while is_outside(x,y)
        disp('select a point')
        [x,y] = ginput(1);
    end
where is_outside is a function with a couple of if-statements.
Cntrl+C works.
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Data Exploration についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

