Conversion to cell from double is not possible
147 次查看(过去 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!