Effacer les filtres
Effacer les filtres

Store columns in a matrix in different variables

10 vues (au cours des 30 derniers jours)
Damith
Damith le 17 Juin 2014
Commenté : Damith le 17 Juin 2014
Hi,
I have a matrix A (5479 x 378). I need to store every column of the matrix A in separate arrays St1, St2, St3....St378. So each St array will have 5479 x 1.
Can somebody help me with this?
Thanks in advance.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 17 Juin 2014
Modifié(e) : Azzi Abdelmalek le 17 Juin 2014
st=num2cell(A,1)
You can access each column by
st{1}
st{2}

Plus de réponses (1)

Jos (10584)
Jos (10584) le 17 Juin 2014
Why do you want to do this? It is much easier to deal with a specific column using indexing A(:,13) then using variable names like St13 …
k = 13
tmp = A(:,k)

Catégories

En savoir plus sur Logical 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