Clear Filters
Clear Filters

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

4 views (last 30 days)
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 Comment
Adam Danz
Adam Danz on 22 Aug 2021
Edited: Adam Danz on 22 Aug 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.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Aug 2021
Edited: Walter Roberson on 22 Aug 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);

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!