필터 지우기
필터 지우기

Update App Designer UITable State

조회 수: 8 (최근 30일)
GDelga
GDelga 2020년 4월 30일
답변: Kanishk Singhal 2023년 7월 13일
Hi, I have this table created in AppDesigner:
% Create UITable
app.UITable = uitable(app.GridLayout4);
app.UITable.ColumnName = {'Date'; 'Front Car'; 'Back Car'; 'Front Truck'; 'Back Truck'; 'Front Motorbike'; 'Back Motorbike'; 'Front Bus'; 'Back Bus'};
app.UITable.RowName = {};
app.UITable.Layout.Row = 1;
app.UITable.Layout.Column = 2;
Then when user press a button, load data in the table:
app.UITable.ColumnName = {"Date"};
for i=1:length(fields)
app.UITable.ColumnName{end+1} = channelInfo.FieldDescriptions{fields(i)};
end
r = horzcat(string(timestamps), string(data));
total = ["TOTAL", string(sum(data))];
r = vertcat(r,total);
set(app.UITable,'Data',cellstr(r));
drawnow;
Table properties change, but are not visible in view. The same thing happens to me with a graph, it loads the data, but it is not seen. What can I do?

답변 (1개)

Kanishk Singhal
Kanishk Singhal 2023년 7월 13일
You have to put this in your button pushed callback function.
ButtonPushedFcn is the callback function for a button which is executed whenever you push the button.
You can add your second block of code in a function and add the function in callback of button using inline function.

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by