MATLAB: How to load a mat file (with its workspace) to GUI

matlab gui

Hi i am beginner in Matlab. i am trying to develop a GUI whereby i can extract some variables from a mat file. do some calculations in the GUI and then saved the output in the workspace again. i find difficulty in: 1. load a mat file with its workspace on gui 2. save the new variables after calculation back to the workspace again
thanks a lot.

Best Answer

You can load the .mat file to your GUI function workspace using
load('YourFile.mat')
Once the vaiabled are loaded and calculation is completed, you can save a variable (say xyz) back to mat file using
save('YourFile.mat','xyz','-append')
For detailed info See
>> doc load
>> doc save