フィルターのクリア

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

4 ビュー (過去 30 日間)
Marco Frieslaar
Marco Frieslaar 2021 年 8 月 21 日
編集済み: Walter Roberson 2021 年 8 月 22 日
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 件のコメント
Adam Danz
Adam Danz 2021 年 8 月 22 日
編集済み: Adam Danz 2021 年 8 月 22 日
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.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 22 日
編集済み: Walter Roberson 2021 年 8 月 22 日
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 件のコメント
Marco Frieslaar
Marco Frieslaar 2021 年 8 月 22 日
Thank you very much Walter.
Adam Danz
Adam Danz 2021 年 8 月 22 日
I'm puzzled about what didn't work in app designer. Was there a problem with uitable?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by