Converting a 4d vector to 2d vector

16 vues (au cours des 30 derniers jours)
Basu Sau
Basu Sau le 23 Fév 2019
Commenté : Basu Sau le 23 Fév 2019
Dear
I would like to convert the following 4d vector to a 2d vector.
input:
Y(:,:,1,1)=0
Y(:,:,2,1)=1
Expected output:
Y1(1,1)=1
Y1(1,2)=2
Thanks,

Réponse acceptée

Jos (10584)
Jos (10584) le 23 Fév 2019
Y = randi(10,1,1,3,4)
Y2 = squeeze(Y) % remove singleton dimensions
help squeeze
  1 commentaire
Basu Sau
Basu Sau le 23 Fév 2019
thanks jos

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion 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