Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to convert cell to matriz

2 visualizaciones (últimos 30 días)
Abraham
Abraham el 17 de Jul. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hi, I am just trying to convert a cell 1828x1cell to a matrix so that I could be able to make some calculation with the values (just integers)
but after writing
data = cell2mat (d);
I get the following error:
_*Error using cat Dimensions of matrices being concatenated are not consistent.
Error in cell2mat (line 84)_ m{n} = cat(1,c{:,n});*
So, how can I solve this problem or what else can I do so that I can do some calculation with the values inside the cell?
  1 comentario
Jan
Jan el 18 de Jul. de 2013
It is a frequently occurring problem of discussions in this forum, that the actual data are not shown. This is caused by the fact, that the data are such obvious for the asking person, that it is forgotten, that the readers do not know them. For this question posting a relevant part of the data is important to understand the cause of the error. So please post some code, which creates a minimal example data set, which reproduces your problem.

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 17 de Jul. de 2013
Editada: Azzi Abdelmalek el 17 de Jul. de 2013
This is because your cell are not the same size
Example
A={[1 2], 2 , [4 5;3 2]}
cell2mat(A) % will give an error
  3 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 18 de Jul. de 2013
Editada: Azzi Abdelmalek el 18 de Jul. de 2013
What do you mean by 2 figures? and what is the problem if the integer is 1 or 18
Jan
Jan el 18 de Jul. de 2013
@Abraham: The error message appears only, if the cell elements have different numbers of elements, while the number of figures are not important -- as long as you talk about numeric data. Which type have the elements?

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by