Store columns in a matrix in different variables

10 ビュー (過去 30 日間)
Damith
Damith 2014 年 6 月 17 日
コメント済み: Damith 2014 年 6 月 17 日
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.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 6 月 17 日
編集済み: Azzi Abdelmalek 2014 年 6 月 17 日
st=num2cell(A,1)
You can access each column by
st{1}
st{2}
  1 件のコメント
Damith
Damith 2014 年 6 月 17 日
Thanks. it worked.

サインインしてコメントする。

その他の回答 (1 件)

Jos (10584)
Jos (10584) 2014 年 6 月 17 日
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)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by