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

조회 수: 2 (최근 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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by