Hi guys I have a 3d matrix with values A(1:3, 1:3, 1:12) and I want to transform them into 2D matrix B where B(1,1)=A(1,1,1) B(2,1)=A(1,2,1) B(3,1)=A(1,3,1) B(4,1)=A(1,1,2)..... B(36,1)=A(1,3,12)
and I would like to to the same for 3 columns. I tried to do it with 'for' loop but it doesn't work. I'd be glad for any help ;)
for i=1:3
for l=1:12
for k=1:3
B(:,)=A(1,k,l);
end
end
end

Respuestas (1)

Star Strider
Star Strider el 3 de Mayo de 2018

0 votos

I would use the reshape function:
B = reshape(A, [], 1);
You may have to experiment with it to get the result you want.

Categorías

Preguntada:

el 3 de Mayo de 2018

Respondida:

el 3 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by