Jump to content

GUI help


dbdb
 Share

Recommended Posts

Hi,

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...')

fid=[newpath,newfile];

load(fid)

l=length(Leds_1_6)

%************************************************************

%* PLOT

function Plot_Callback(hObject, eventdata, handles)

global X Y Z A B C l Leds_1_6 Time MetrisFileInfo

if get(handles.X,'Value')

plot(Leds_1_6(1,2:l))

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??

Thanks!

Edited by dbdb
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...