Azzera filtri
Azzera filtri

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

4 visualizzazioni (ultimi 30 giorni)
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 Commento
Adam Danz
Adam Danz il 22 Ago 2021
Modificato: Adam Danz il 22 Ago 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.

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 22 Ago 2021
Modificato: Walter Roberson il 22 Ago 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 Commenti
Adam Danz
Adam Danz il 22 Ago 2021
I'm puzzled about what didn't work in app designer. Was there a problem with uitable?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by