Borrar filtros
Borrar filtros

convert matrix of cells into matrix of vectors

1 visualización (últimos 30 días)
Hadeel
Hadeel el 31 de Oct. de 2022
Editada: Jan el 31 de Oct. de 2022
hello,please i have matrix of cells contain 32*32 cells,each cell have 8*8 double values,i want to covert this matrix into matrix of vectors such as the size of the resulting matrix is 1024*64,i trying in this code but the size views as 32*64,where A1 is a cells matrix
for i=1:size(A1,2)
for j=1:size(A1,2)
A2(j,:)=reshape(cell2mat(A1(i,j)),1,[])
end
end

Respuestas (1)

Jan
Jan el 31 de Oct. de 2022
Editada: Jan el 31 de Oct. de 2022
There are different method to concatenate the matrices to the wanted output. One is:
X = cat(1, A1{:});
X = reshape(X, 1024, 64);
Joining along the 2nd or 3r dimension is possible also: cat(2, ... or cat(3, ... .
In your codeyou overwrite A(j, :) repeatedly in the inner loop.

Categorías

Más información sobre Images en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by