For and Break ; in Guide
3 ビュー (過去 30 日間)
古いコメントを表示
Hi all, Get out of the loop "for" for guide
"
---------------------------------------------------------------------
K=handles.b
function pushbutton2_Callback(hObject, eventdata, handles)
for i=1:n;
%event
if (K==1)
break
end
end
guidata(hObject, handles);
---------------------------------------------------------------------
function rd_1_Callback(hObject, eventdata, handles)
if (get(hObject,'Value') == get(hObject,'Max'))
handles.b=1;
else
handles.b=2;
end
guidata(hObject, handles);
----------------------------------------------------------------------
trying "K=handles.b" Instead of typing "K=1" above
I want,while loop "for", any button or raddio_button or listbox ,stop with an impact.
採用された回答
Arturo Moncada-Torres
2011 年 5 月 8 日
Hello,
Quan Quach has an excellent tutorial regarding this issue. I this this is just what you need:
Regards,
Arturo M.
4 件のコメント
Arturo Moncada-Torres
2011 年 5 月 13 日
I am glad it helped. I had the same issue and spend a lot of time searching for the answer. Cheers!
その他の回答 (1 件)
Walter Roberson
2011 年 5 月 8 日
for i=1:n;
pause();
if (get(handles.b,'Value')==1)
break
end
end
1 件のコメント
Matt Fig
2011 年 5 月 13 日
I don't think the user wants to hit return every loop iteration!
pause(.001)
参考
カテゴリ
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!