Turning 2D array (58x23) into 4D array (58x1x23x1)
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!