I keep getting an error?

5 visualizaciones (últimos 30 días)
Amanda
Amanda el 1 de Nov. de 2022
Respondida: Star Strider el 1 de Nov. de 2022
I am trying to take data that is stored in a cell and divide it but another variable but I keep getting and operator './' is not supported for operand of type 'cell'. I dont know how to fix this issue but for reffrence here is what i have writen so far.
  1 comentario
David Hill
David Hill el 1 de Nov. de 2022
Attach a sample of your data.

Iniciar sesión para comentar.

Respuestas (2)

James Tursa
James Tursa el 1 de Nov. de 2022
Generally, these types of problems are solved by extracting the contents of the cell instead of using the cell itself. E.g.,
C = {10,20,30}
C = 1×3 cell array
{[10]} {[20]} {[30]}
C{3} ./ C{1} % use curly braces to extract the content of the cell
ans = 3
C(3) ./ C(1) % this tries to divide the cell itself and generates an error
Operator './' is not supported for operands of type 'cell'.

Star Strider
Star Strider el 1 de Nov. de 2022
It may be necessary to use the cell2mat function if the arrays are in a cell array. The existing cell array elements must be purely numeric of the same class, and must have consistent dimensions that allows for them to be concatenated.
Once they are in a matrix, you can work with them as array elements.

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by