How to get rid of NaN when entered value other than numeric value in UI table in appdesigner?
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to pass/edit the array(eg [1,2,3]) in the table cell. but when i press enter it show Nan. So what changes i have to make inorder to to the value as it is entered?
I even gave newRow = repmat({''},1,numCols) but than when i try to add value , it shows error msg. index aeceeds array . Please help me.
댓글 수: 0
답변 (1개)
BhaTTa
2025년 7월 18일
When you enter something that doesn't match, it often defaults to NaN for numeric columns,the simplest way to fix it is it set ColumnFormat to 'char' or 'string' for the column where you want to type [1,2,3]. MATLAB will then treat it as text, not try to convert it to a single number, and thus won't produce NaN. You'll then process the text yourself in your code.
Hope it helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!