Effacer les filtres
Effacer les filtres

Looping matrix into one column

2 vues (au cours des 30 derniers jours)
Karlito
Karlito le 30 Mar 2012
How would it be possible for me to create a single column from a matrix which has 5000 columns. I need each column to remain as they are. To get the mentioned matrix first place i'm using a for-loop. Do i have to define it in the loop then?

Réponse acceptée

Thomas
Thomas le 30 Mar 2012
doc reshape
Reshpae should do your job, try the following example
a=[1:4;5:8;9:12;13:16]
c=reshape(a,[],1)
  1 commentaire
RNTL
RNTL le 30 Mar 2012
column = matrix(:);

Connectez-vous pour commenter.

Plus de réponses (1)

Karlito
Karlito le 3 Avr 2012
Thanks a lot, that worked like a charm!

Catégories

En savoir plus sur Matrices and Arrays 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