主题:如何在采集数据的窗口中设置停止按钮?
sunburn6192
[专家分:0] 发布于 2007-07-18 17:00:00
我用MATLAB编了一个采集数据的程序,采集到的数据以图形方式实时显示。我想在图形窗口上加一个按钮,按下按钮后就可以暂停采集数据,不知该如何实现。
多谢高手指点。
回复列表 (共2个回复)
沙发
hubinwi [专家分:140] 发布于 2007-07-19 02:27:00
用DBSTOP
DBSTOP Set breakpoint.
The DBSTOP command is used to temporarily stop the execution of an
M-file function and give the user an opportunity to examine the local
workspace. Issuing a DBSTOP command is equivalent to editing the
M-file function and inserting a KEYBOARD command in front of the line
number specified. There are five forms to this command. They are:
DBSTOP IN MFILE AT LINENO
DBSTOP IN MFILE AT SUBFUN
DBSTOP IN MFILE
DBSTOP IF ERROR
DBSTOP IF WARNING
DBSTOP IF NANINF or DBSTOP IF INFNAN
where LINENO is a line number within M-file function MFILE. MFILE
must be the name of an m-file function or a MATLABPATH relative
partial pathname (see PARTIALPATH). The AT, IN and IF keywords
are optional.
The first form stops at the specified line number in the function.
The second form stops at the specified subfunction in the
multi-function m-file.
The third form stops at the first executable line in the function.
The fourth form causes a stop in any M-file function causing a
run-time error. You cannot resume M-file execution after a
run-time error.
The fifth form causes a stop in any M-file function causing a
run-time warning.
The sixth form causes a stop in any M-file function where an
infinite value (Inf) or Not-a-Number (NaN) is detected.
When a breakpoint is hit, MATLAB goes into debug mode. On the PC
and Macintosh the debugger window becomes active and on UNIX and VMS
the prompt changes to a K>. Any MATLAB command is allowed at the
prompt. To resume M-file function execution, use DBCONT or DBSTEP.
To exit from the debugger use DBQUIT.
板凳
sunburn6192 [专家分:0] 发布于 2007-07-19 08:40:00
谢谢,我试试吧。
我来回复