Conversion to cell from double is not possible

150 visualizaciones (últimos 30 días)
Tolulope Abiola
Tolulope Abiola el 16 de Ag. de 2019
Comentada: Daniele De Gregorio el 19 de Jul. de 2023
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.

Respuesta aceptada

Stephen23
Stephen23 el 16 de Ag. de 2019
Editada: Stephen23 el 16 de Ag. de 2019
A = cell2mat(dataC(:,1));
B = A * pi * 2;
dataC(:,3) = num2cell(B); % <- you need NUM2CELL!
  6 comentarios
Stephen23
Stephen23 el 25 de Ag. de 2019
@Tolulope Abiola: either make sure that the uitable column is numeric, or convert to numeric after obtaining the data from the uitable.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by