get the table from uitable into a matrix A
9 ビュー (過去 30 日間)
古いコメントを表示
tableData = get(handles.uitable1, 'Data')
tableData =
'99' [41]
'77' [13]
can i convert it to a normal matrix so i can do a function on it
5 件のコメント
Walter Roberson
2018 年 2 月 21 日
Do you want the '99' to be converted to numeric so that you end up with a purely numeric array?
採用された回答
Guillaume
2018 年 2 月 21 日
編集済み: Guillaume
2018 年 2 月 21 日
Your uitable returns a cell array because you've defined the first column as char. If your uitable is supposed to contain numbers only then the easiest way to fix your problem, is to change the ColumnFormat of that first column to 'numeric'. If you show us the line(s) where you create that uitable we can give you the exact syntax.
Alternatively, it can be fixed after the fact, but it'll be slower and kind of pointless:
tableData = get(handles.uitable1, 'Data');
tableData = [str2double(tableData(:, 1)), cell2mat(tableData(:, 2))];
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!