NaN elements during table data input - Matlab GUI
古いコメントを表示
I have a simple gui with a table: three columns, all set to editable, containing texts. With an additional button I can append empty rows to the end of the table. However, every time I write something in the new, empty cells at the bottom of the table and hit enter the value automatically changes to NaN. I've figured out that if I write a numerical value in the cells, there's no problem, so because of some reason matlab handles the new cell elements as if their type would be numeric. Any ideas how to solve this? I tried to add a CellEditCallback to the object, but the value update seems to happen before the callback would be evaluated...
2 件のコメント
Baris Gungordu
2015 年 1 月 19 日
Dear Peter,
I have the same problem. I want the user to define only the first column for each added row. However, I could not apply your code.
I create my table with the following code: (Counters are used to number the rows created)
counter1 = counter1 + 1;
data = get(handles.uitable1, 'Data');
data(end+1,:) = [0 counter1-counter2+1 0 0 0 0];
set(handles.uitable1,'Data',data)
The rows created are all 0's and user can edit it. I want the first 0 to be 'Name' and to be editable by the user. I appreciate if you can give me an idea.
Peter Borda
2015 年 1 月 23 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!