GUI Call back Function Error!
显示 更早的评论
Im trying to create a button that prompts user to select file to load and display.
function loadbutton_Callback(hObject, eventdata, handles)
[datafile datadir] = uigetfile('*.csv');
end
When I run this code on a separate file it works but when I added to my code it gives this error
*Function definitions are not permitted in this context.*
采纳的回答
更多回答(1 个)
Yasaman Best
2017-3-22
0 个投票
1 个评论
Adam
2017-3-22
It isn't odd, it is for the reason I explained in my answer. Subfunction definitions are not allowed in a script. Apparently they are in the lastest version of Matlab, but I've never tried them. I try to avoid scripts as much as possible!
类别
在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!