Turning 2D array (58x23) into 4D array (58x1x23x1)
Mostrar comentarios más antiguos
I would like to turn a 2D array of size 58x23 into a 4D array of size 58x1x23x1. I assume that the answer is rather simple using MATLAB's cat and permute functions. I need this specific format in order to use Simulink's LPV System.
A = rand(58,23);
A2 = cat(4, A, A); % array of size [58 23 1 2]
A3 = permute(A2, [1 3 2 4]); % array of size [58 1 23]
I can't get any further than the above dimensions and would appreciate any help.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!