- #1
renuka1011
- 1
- 0
Hi...
Me too new to this concept. I too want to load a .m file by pressing the button in the GUI.
I am the beginner to matlab. I have added 3 buttons to my gui and if i click on the first button means then i want the .m file stored in the same directory be loaded and automatically that .m file will begin its execution. I don't know how to load the .m file on clicking the button in my gui window.Please help me.
and the code that i have used is
[FileName,PathName] = uigetfile('*.m','Select the file');
if FileName==0, return, end
Struct1 = load( fullfile(PathName,FileName) );
Structname = fieldnames(Struct1);
but the .m file is not loaded i have error in this code..
plese help me
Me too new to this concept. I too want to load a .m file by pressing the button in the GUI.
I am the beginner to matlab. I have added 3 buttons to my gui and if i click on the first button means then i want the .m file stored in the same directory be loaded and automatically that .m file will begin its execution. I don't know how to load the .m file on clicking the button in my gui window.Please help me.
and the code that i have used is
[FileName,PathName] = uigetfile('*.m','Select the file');
if FileName==0, return, end
Struct1 = load( fullfile(PathName,FileName) );
Structname = fieldnames(Struct1);
but the .m file is not loaded i have error in this code..
plese help me