Infinite Loop in GUI Matlab

2 次查看(过去 30 天)
Michael Adelman
Michael Adelman 2012-7-8
Hi all,
I'm writing a gui and wanted to know if there is any option to write an infinite loop (while 1) in the OpeningFcn and be able to run rest of the gui at the same time?
If you have other option I'll be happy to hear.
p.s. I don't want to use any buttons as a condition for that loop.
Thanks,
  5 个评论
Michael Adelman
Michael Adelman 2012-7-9
Thanks guys. I created a togglebutton and used while get(hObject,'Value') to get into the loop.
Now I get other issue, while the togglebutton is pressed the loop is running and if I want to close the gui window while the loop is running I get following errors:
??? Error using ==> plot Data must be a single matrix Y or a list of pairs X,Y
Error in ==> Voice_measure_gui>Start_Callback at 115 plot(handles.time_domain,time,data)
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> Voice_measure_gui at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)Voice_measure_gui('Start_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
The intention of the code is to sample voice speech and to plot its time domain and freq. domain in real time.
Please advice
Jan
Jan 2012-7-9
@Michael: A new question requires a new thread. Adding a completely new question as comment to another one does not match the forum's intention. So please create a new thread, delete your comment, and add the first line as answer.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by