【发布时间】:2011-12-12 13:10:58
【问题描述】:
我对 MATLAB 编程完全陌生,但我收到了一个脚本,不知怎的,我忽略了 functions 的所有 end 语句。
例如:
function pushbutton_open_Callback(hObject, eventdata, handles)
[FileName,PathName,FilterIndex] = uigetfile('*.txt','Select the CONFIG file');
if FileName~=0
init_session(hObject, FileName, PathName);
end
% shouldn't there be an "end" here?
function pushbutton_start_Callback(hObject, eventdata, handles)
% ....
那个风格“好吗”?显然,当我尝试运行它时,没有语法错误,而且无论何时我们使用它,该程序都可以运行。函数会自动运行到下一个function 语句吗?
【问题讨论】: