Effacer les filtres
Effacer les filtres

how to divide a matrix into groups

2 vues (au cours des 30 derniers jours)
farfar
farfar le 14 Oct 2018
Modifié(e) : madhan ravi le 14 Oct 2018
Hello I have a matrix lets say with 12by1.
A=[0;0.2;0.25;0.3;1;1.5;4;4.75;5;6;9;10]
how can i group this matrix into 3 equal (4by1) matrices like: a=[0;0.2;0.25;0.3] b=[1;1.5;4;4.75] c=[5;6;9;10]
Thank you.

Réponse acceptée

madhan ravi
madhan ravi le 14 Oct 2018
Modifié(e) : madhan ravi le 14 Oct 2018
A=[0;0.2;0.25;0.3;1;1.5;4;4.75;5;6;9;10]
A=reshape(A,4,3)
a=A(:,1)
b=A(:,2)
c=A(:,3)
  1 commentaire
madhan ravi
madhan ravi le 14 Oct 2018
Modifié(e) : madhan ravi le 14 Oct 2018
Make sure to accept the answer if it worked.

Connectez-vous pour commenter.

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