필터 지우기
필터 지우기

Looping matrix into one column

조회 수: 2 (최근 30일)
Karlito
Karlito 2012년 3월 30일
How would it be possible for me to create a single column from a matrix which has 5000 columns. I need each column to remain as they are. To get the mentioned matrix first place i'm using a for-loop. Do i have to define it in the loop then?

채택된 답변

Thomas
Thomas 2012년 3월 30일
doc reshape
Reshpae should do your job, try the following example
a=[1:4;5:8;9:12;13:16]
c=reshape(a,[],1)
  댓글 수: 1
RNTL
RNTL 2012년 3월 30일
column = matrix(:);

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

추가 답변 (1개)

Karlito
Karlito 2012년 4월 3일
Thanks a lot, that worked like a charm!

카테고리

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