For and Break ; in Guide
显示 更早的评论
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.
采纳的回答
更多回答(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)
类别
在 帮助中心 和 File Exchange 中查找有关 Operators and Elementary Operations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!