I'd want the code that given the vector B
B=[ 1 2 8 9 0 7 1 9 8 7 2 4 5 0 8 3 3 7 6 1]
return the matrix
B=[1 2 8 9 0; 7 8 9 1 7; 2 4 5 0 8; 1 6 7 3 3]
or for example:
from A=[ 1 2 4 3 0 1 5 3 7 9]
to A=[1 2; 3 4; 0 1; 3 5; 7 9]
thanks

댓글 수: 1

Guillaume
Guillaume 2018년 11월 24일
How is the number of rows or columns of the result determined from the vector?

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

 채택된 답변

madhan ravi
madhan ravi 2018년 11월 24일

0 개 추천

Use reshape()

댓글 수: 1

Guillaume
Guillaume 2018년 11월 25일
@cami, it's interesting that you've accepted this answer since reshape on its own is incapable of producing the result you asked. Now, if you'd answered my question you could have had an answer that did what you wanted.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2018년 11월 24일

댓글:

2018년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by