필터 지우기
필터 지우기

Convert a column vector to an array matrix

조회 수: 122 (최근 30일)
Mudasser Seraj
Mudasser Seraj 2018년 2월 11일
편집: the cyclist 2021년 6월 30일
Hi, Suppose, I have a 500x1 column vector How do I convert it into a 25x20 array matrix where 1st column values of the matrix will be 1st 25 values of the vector and so on.
  댓글 수: 2
M Ray
M Ray 2021년 6월 26일
How to convert 1*259 row vector into a matrix by which first row of the matrix will be first 50 values, second row will be the 3rd element of row vector to 54 elements and so on...
FOR eg:[1 2 3 ........50; 4 5 ........53; 6,7......,55]
the cyclist
the cyclist 2021년 6월 30일
편집: the cyclist 2021년 6월 30일
I suggest you open a new question. A comment on a 3-year-old question won't get much exposure.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2018년 2월 11일
편집: the cyclist 2018년 2월 11일
Use the reshape command.
M = reshape(V,25,20)

추가 답변 (1개)

Naufal Fathoni
Naufal Fathoni 2019년 7월 8일
same case, but i will change 25 x 50 array matrix, but the first row matrix must be 1-50? Thanks.
  댓글 수: 1
the cyclist
the cyclist 2019년 7월 8일
I'm not sure what you mean, but I think what you want is
M = reshape(V,50,25)';
If that is not what you want, I suggest you open a new question, with a bit more description (rather than writing an "answer" here).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by