필터 지우기
필터 지우기

when I use app designer, it tells me error of 'Value' must be a character vector or a string scalar.

조회 수: 8 (최근 30일)
I have write a script,I want to get tabulate(u), "u" is a matrix (200x1 double)。the result is as follows:
Value Count Percent
1 0 0.00%
2 0 0.00%
3 0 0.00%
4 0 0.00%
5 0 0.00%
6 91 45.50%
7 0 0.00%
8 109 54.50%
Then I want to do the script in app designer,I creat a edit field (text) which is used to display the tabulate.
but it always error:
z1=tabulate(u);
app.lousunEditField.Value=z1
then it tells "Error using matlab.ui.control.EditField/set.Value (line 98)
'Value' must be a character vector or a string scalar."
I have tried the string、num2str,it still doesn't work.

채택된 답변

Mario Malic
Mario Malic 2021년 2월 5일
Hi,
z1 is a table, and Value doesn't accept tables. You can create a UITable component and just assign z1 to it
app.UITable.Data = z1;
If you insist on EditField components, index into the table using curly brackets.
  댓글 수: 4
neal paze
neal paze 2021년 2월 5일
I still want to know more about how to index into the table using curly brackets.
THANKES!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by