How to turn a column vector into a 3D matrix?

4 vues (au cours des 30 derniers jours)
zephyr21
zephyr21 le 24 Juin 2016
I have a 324x1 matrix, and I would like to put it into a 3-D 9x12 matrix of i,j,k with the first numbers in the vector going to the first layer and after that fills up start filling the second layer.

Réponse acceptée

KSSV
KSSV le 24 Juin 2016
A = rand(324,1) ;
M = 9*12 ;
N = 324/M ;
K = reshape(A,[9 12 N]) ;

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by