Construct data matrix from single column

11 ビュー (過去 30 日間)
ABDULAZIZ
ABDULAZIZ 2014 年 4 月 24 日
コメント済み: ABDULAZIZ 2014 年 4 月 24 日
Hello
I am stuck with one problem: I have one column has 31000 observations , and need to get each consecutive 62 rows from that column and put in a new matrix , so at the end I will have 62 X 500 matrix. For example I will take first 62 observations from the column of 31000 and this will be my fist column in my new matrix , then the next 62 from the column of 31000 as my second column in my new matrix ... continue up to the last 62 observations in my 310000 obs.
Toy Example
x=[1;2;3;4;5;6;7;8;9;10]
so from X I will take each 2 rows and make it as one column in a new matrix Y, so I will have my Y matrix like this y=[1 3 5 7 9;2 4 6 8 10]
Thank you in advance.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 4 月 24 日
reshape(A,62,500)
  1 件のコメント
ABDULAZIZ
ABDULAZIZ 2014 年 4 月 24 日
Wow. Thank you very so much 100%

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by