필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
ElizabethR
ElizabethR 2016년 6월 18일
댓글: ElizabethR 2016년 6월 20일
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

채택된 답변

Geoff Hayes
Geoff Hayes 2016년 6월 19일
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
Geoff Hayes
Geoff Hayes 2016년 6월 19일
편집: Geoff Hayes 2016년 6월 19일
Elizabeth - see http://www.mathworks.com/matlabcentral/answers/146215-pass-data-between-gui-s for an example of how to pass data between two GUIs.
ElizabethR
ElizabethR 2016년 6월 20일
Hi Geoff, thank you so much. God Bless you ^^

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by