reshape a column vector in a row-wise direction?

조회 수: 15 (최근 30일)
Ernest Adisi
Ernest Adisi 2018년 8월 16일
편집: James Tursa 2018년 8월 16일
if I have column vector A= 1;2;3;4;5;6;7;8;9;10 how do I get matlab to reshape it in the row wise direction so it becomes
A= 1 2 3 4 5
6 7 8 9 10
as the reshape function seems to take it in column wise direction format?

채택된 답변

KSSV
KSSV 2018년 8월 16일
A= [1;2;3;4;5;6;7;8;9;10 ] ;
B = reshape(A,[],2)'
  댓글 수: 3
Ernest Adisi
Ernest Adisi 2018년 8월 16일
hey thanks for answering, if i want it reshaped with a certain row r column c, would it be reshape(A,[],r,c)'. I have to import data from a column vector into a certain r and c
Ernest Adisi
Ernest Adisi 2018년 8월 16일
oh got it now thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by