Effacer les filtres
Effacer les filtres

Update App Designer UITable State

8 vues (au cours des 30 derniers jours)
GDelga
GDelga le 30 Avr 2020
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?

Réponses (1)

Kanishk Singhal
Kanishk Singhal le 13 Juil 2023
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.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by