Effacer les filtres
Effacer les filtres

Appdesigner: Tables - how to set the data type for each column ?

4 vues (au cours des 30 derniers jours)
Marco Frieslaar
Marco Frieslaar le 21 Août 2021
Modifié(e) : Walter Roberson le 22 Août 2021
I have created a table in Appdesigner and I would like to include both numbers and text in different columns.
For example, I have set the column headings as:-
Tuning_Array_Table.Properties.VariableNames = {'Iteration', '2norm', 'Converg.', 'PID_Bd', 'ILC_Bd', 'Kp', 'Ki', 'Kd', 'ILC_Method', 'Q_Weight', ...
'Cut-off Freq.', 'LTI_LTV', 'Update'}
How can I set the data-type as 'numeric' for the first eight columns, but then - for column 9 ('ILC_Method') - how can I have either 'NOIC', 'Inverse' or 'Gradient' in the table cells themselves i.e. text ?
I have been able to get it to work in Matlab, but the code does not work in Appdesigner. I think it is because I have not been able to successfully set the column data types (I am confused as to how to do that and the Matlab 'help' documents are not helpful on this subject).
Or perhaps, I am barking up the wrong tree and need a completely different method of approach ?
Can one of you gifted indivduals please point me in the right direction ?
Thank you in advance.
  1 commentaire
Adam Danz
Adam Danz le 22 Août 2021
Modifié(e) : Adam Danz le 22 Août 2021
The phrase "[It] doesn't work" never provides sufficient information to confirm, diagnose, and remedy a problem. It's like telling the doctor, "I'm sick" without providing more info.
What we need to know is exactly what's not working in AppDesigner, what sympoms you're seeing that makes you believe something's not working, and evidence that it's not working.
A sample of your table (first few hows) would be helpful to share and, if it's not obvious from the sample, a description of the data types in each column of the table.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 22 Août 2021
Modifié(e) : Walter Roberson le 22 Août 2021
Instead of creating the table like
whatever followed by
Tuning_Array_Table.Properties.VariableNames = {'Iteration', '2norm', 'Converg.', 'PID_Bd', 'ILC_Bd', 'Kp', 'Ki', 'Kd', 'ILC_Method', 'Q_Weight', ...
'Cut-off Freq.', 'LTI_LTV', 'Update'}
change to
tr = 30; %30 rows
vt = repmat("double", 1, 13); vt(9) = "cell";
vn = {'Iteration', '2norm', 'Converg.', 'PID_Bd', 'ILC_Bd', 'Kp', 'Ki', 'Kd', 'ILC_Method', 'Q_Weight', ...
'Cut-off Freq.', 'LTI_LTV', 'Update'};
Tuning_Array_Table = table('Size', [tr, length(vn)], 'VariableTypes', vt, 'VariableNames', vn);
  2 commentaires
Marco Frieslaar
Marco Frieslaar le 22 Août 2021
Thank you very much Walter.
Adam Danz
Adam Danz le 22 Août 2021
I'm puzzled about what didn't work in app designer. Was there a problem with uitable?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by