How to get rid of NaN when entered value other than numeric value in UI table in appdesigner?

2 次查看(过去 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.

回答(1 个)

BhaTTa
BhaTTa 2025-7-18
Hey @madhura patil, i have a workaround for you, please refer below:
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.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by