Update uitable data in matlab gui

조회 수: 1 (최근 30일)
Hector Prieto
Hector Prieto 2014년 2월 2일
댓글: Hector Prieto 2014년 2월 2일
Dear all,
I am trying to design a gui in matlab where the calculations made by the user be stored in a uitable. So far, I can "Store" the data previosly calculated by the user, including the name of the first row and multiple calculations be stored as well. Unfortunately, I am stuck trying to update the name of the rows related to those new calculations.
Below you will find part of the code in case you can help me in solving my problem.
Thanks in advance!
Héctor
function SavePushButton_Callback(~,~)
%%##
data{1,1}= get(h5Out,'string');
data{1,2}= get(h6Out,'string');
data{1,3}= get(h7Out,'string');
data{1,4}= get(h8Out,'string');
oldData = get(t,'Data');
newRow = cat(0,data,cell(0,size(data,2)));
newData2 = [oldData; newRow];
set(t,'Data',newData2);
backgroundColor = [.5 .41 .21; .31 .45 .64];
rowname = get(h1Out,'string');
set(t,'Rowname',rowname);
% Table Background color
set(t, 'BackgroundColor', backgroundColor);
set(t, 'ColumnEditable', [true false false false]);
end

답변 (1개)

Walter Roberson
Walter Roberson 2014년 2월 2일
You need to set all the Rowname entries at the same time.
  댓글 수: 1
Hector Prieto
Hector Prieto 2014년 2월 2일
Dear @Walter Roberson,
Thank you for your prompt response. Could you please tell me how to do that?
Thanks in advance
Héctor

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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by