Reputation: 3
How can I open a script in editor from a GUI push button callback?
I've tried:
function load_Callback(hObject, eventdata, handles)
uiopen(myfile.m)
But it doesn't work!
Cheers,
Toby
Upvotes: 0
Views: 559
Reputation: 383
First you need to use the function open
Then you need to enquote the name of the file in the parameters like :
open('myfile.m') %this will open the exact file 'myfile.m'
This will open the file in the editor.
You can use uiopen
to let the user chose the file.
uiopen() %this will prompt the user to choose file
I suggest you take a look here:
http://www.mathworks.com/help/matlab/ref/open.html http://www.mathworks.com/help/matlab/ref/uiopen.html
Upvotes: 1