MATLAB Answers

How to show .mat file into table ( guide ) in GUI matlab ?

32 views (last 30 days)
ElizabethR
ElizabethR on 18 Jun 2016
Commented: ElizabethR on 20 Jun 2016
i have a .mat file ( 30x37 cell ) and i want to show it in the uitable with click on push button. So how to make it ? thank you

  0 Comments

Sign in to comment.

Accepted Answer

Geoff Hayes
Geoff Hayes on 19 Jun 2016
Elizabeth - load the mat file (in your callback function) and then update the Data property of the uitable with this new cell data. For example,
function pushbutton1_Callback(hObject, eventdata, handles)
% load the data (assume hard-coded filename)
myData = load('myMatFile.mat');
% update the uitable
set(handles.uitable1,'Data',myData.myCellArray);
The above assumes that the pushbutton to load the mat file is named pushbutton1 and that the table to load the data into is named uitable1. When we invoke the load call, myData becomes a structure whose fields are the variables stored in the mat file. So where I access the cell array with the field myCellArray, you would replace this with the true name of the array (named however you saved it as).

  3 Comments

ElizabethR
ElizabethR on 19 Jun 2016
hi Geoff thanks for answare, but how to show the value from .mat in the table if the table is in the new window ??
i have 2 GUi, the pushbutton is in the GUI 1, when i click it, it will go in the GUI 2 and show the .mat value in table in GUi 2. how to make it ?
ElizabethR
ElizabethR on 20 Jun 2016
Hi Geoff, thank you so much. God Bless you ^^

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!