How to convert a one column vector to a matrix with N number of rows and M number of colunms

1 回表示 (過去 30 日間)
Hi Everybody.
I want to split up a 45019 x 1 vector into a 268 x 168 matrix.
The matrix should to be constructed so that the first 168 timesteps in the vector should be the first row and the next 168 time steps should be in the second row - and so forth.
can anybody help me, i have no idea how to write this.

採用された回答

Alex Mcaulley
Alex Mcaulley 2019 年 6 月 19 日
Let A your row vector, then:
res = reshape(A,[],168)';

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by