Conversion to cell from double is not possible
152 ビュー (過去 30 日間)
古いコメントを表示
I am trying to do some column calculations in MATLAB Gui columns. Like 2*pi*column1 gives column 3... So I used the code
dataC = get(handles.uitable1, 'Data'); dataC(:,3) = cell2mat(dataC(:,1)) * pi * 2;
Ans this gives error of conversion to cell from double is not possible in reference to the last line of the code.
0 件のコメント
採用された回答
Stephen23
2019 年 8 月 16 日
編集済み: Stephen23
2019 年 8 月 16 日
A = cell2mat(dataC(:,1));
B = A * pi * 2;
dataC(:,3) = num2cell(B); % <- you need NUM2CELL!
6 件のコメント
Stephen23
2019 年 8 月 25 日
@Tolulope Abiola: either make sure that the uitable column is numeric, or convert to numeric after obtaining the data from the uitable.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!