我一直在用quit
命令关闭MATLAB。但是,最近我发现exit
是相同的,除了它保存了Editor window
,这对我很有帮助。
MATLAB对exit
的帮助说:
It performs the same as quit and takes the same termination options.
它们是相同的,但我发现它们有一些差异。
Q1:还有其他差异吗?
Q2:应该使用哪一个来关闭MATLAB?
答案 0 :(得分:4)
A2:任何,其功能相同
A1:不,没有记录差异
2.2 Quitting
============
-- Built-in Function: exit ( STATUS )
-- Built-in Function: quit ( STATUS )
Exit the current session. If the optional integer value
STATUS is supplied, pass that value to the operating system as the exit status.
The default STATUS value is zero.
-- Built-in Function: atexit ( FUNCT )
-- Built-in Function: atexit ( FUNCT, FLAG )
Register a function to be called when exits. For example,
function last_words () %% .DEF
disp ( "Bye bye" );
endfunction
atexit ( "last_words" ); %% .REG last_words() via atexit()
will print the message "Bye bye" when session exits.
The additional argument FLAG will register or unregister FUNCT from
the list of functions to be called when session exits. If FLAG is
true, the function is registered, and if FLAG is false, it is
unregistered. For example, after registering the function
`last_words()' above,
atexit ( "last_words", false ); %% !REG remove registered FUNCT
will remove the function from the list and session will not call
`last_words' when it exits.
Note that `atexit' only removes the first occurrence of a function
from the list, so if a function was placed in the list multiple
times with `atexit', it must also be removed from the list
multiple times.