How to store data in app.UITable

2 vues (au cours des 30 derniers jours)
ONG KX
ONG KX le 15 Mar 2020
Commenté : ONG KX le 19 Mar 2020
I was trying to insert date from date picker in 2nd column of UITable with the corresponding . But, it only display in date vector format. May I know where is my mistake?
rownum = app.Spinner.Value;
date = char(app.DatePicker.Value);
app.UITable.ColumnFormat = {'numeric','char'};
app.UITable.Data(rownum,:) = [rownum,date];
Btw, I had tried with datestr and cellstr. But nothing work
  6 commentaires
Mohammad Sami
Mohammad Sami le 17 Mar 2020
Can you try using a table variable instead.
You can add a property to store the table.
% startup function to initialise the table
% add a property tablevar
% app.tablevar = table(....)
app.uitable.Data = app.tablevar;
% callback
app.tablevar.date(rownum) = datestr(app.DatePicker.Value);
app.uitable.Date = app.tablevar;
ONG KX
ONG KX le 19 Mar 2020
Thanks for answering my question, I switch to datevec instead

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by