function without matching end
53 次查看(过去 30 天)
显示 更早的评论
hello everyone,
I have got a m file which reads in data and plots the data in a GUI. In the main file itself there are many functions written. My understanding was that each function needs an end statement. In the code that I have functions are without end statement. What could be the reason for this . I am copying part of code for reference.
function panel_sp_1_CreateFcn(hObject, eventdata, handles)
set(hObject, 'UserData', 0);
The above function is from my code. The function does not have an end statement.
0 个评论
采纳的回答
Jan
2013-7-4
The trailing "end" is a new feature in Matlab, which is required for nested functions. The old style without a trailing "end" will be kept for backward compatibility without any drawbacks. But when the programmer decides to use the new nested functions or the new style for one of the functions stored in an M-file, all functions must be closed by an "end" to keep the integrity.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!