Jump to content
Sign in to follow this  

GUI help

Recommended Posts



I'm trying to load data from a MAT file into my M file when creating a GUI.

Is there a way to access the variable names and print them on the screen??

I've used 'load('filename', 'X', 'Y', 'Z')' command but you seem to need to know the actual variable name.

The code is:


function OpenFile_Callback(hObject, eventdata, handles)

global X Y Z A B C Q l Leds_1_6 Time MetrisFileInfo

[newfile,newpath]=uigetfile('*.mat','Open File...')






function Plot_Callback(hObject, eventdata, handles)

global X Y Z A B C l Leds_1_6 Time MetrisFileInfo

if get(handles.X,'Value')


title('Plot of X Values');


The variables of the MAT file being Leds_1_6, Time and MetrisFileInfo. The class of the variables is double, double and char respectively.

I want to be able to open other MAT files which will have different variable names..

Any ideas??


Edited by dbdb

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this