About trasfor two dimensions to three dimensions
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
min wong
el 9 de Oct. de 2016
Respondida: Marc Jakobi
el 9 de Oct. de 2016
I want to ask a simple question,but I just can't solve it.
My data follow below
A=(23*25). B=(23*25)
Then I want to change A & B to C=(6*23*25)
The c(1,:,:),c(2,:,:)and c(3,:,:)are A
The c(4,:,:),c(5,:,:)and c(6,:,:)are B
How can I use loop or something to make it happen?
Thanks
1 comentario
Respuesta aceptada
Marc Jakobi
el 9 de Oct. de 2016
I assume 23*25 are the dimensions of the matrices?
You could do something like this:
c = zeros(6, 23, 25);
c(1:3,:,:) = permute(repmat(A,1,1,3),[3,1,2]);
c(4:6,:,:) = permute(repmat(B,1,1,3),[3,1,2]);
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!