필터 지우기
필터 지우기

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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by