How to change the fill in order of the subplot function ?

조회 수: 9 (최근 30일)
Chakib
Chakib 2013년 8월 12일
I want to change the fill in order of the subplot function.
This is the order of the current subplot : http://imageshack.us/photo/my-images/5/tism.png/
In other terms, I want to fill columns after columns instead of lines after lines.
Sorry for my english and thanks for your time.
BELAFDIL Chakib

채택된 답변

the cyclist
the cyclist 2013년 8월 12일
편집: the cyclist 2013년 8월 12일
That ordering is not changeable. (It frustrates me, too, since it is different from the normal linear index ordering!)
I think this function will do the conversion for you:
% The size of the matrix
M = 3;
N = 4;
% The index according to your preferred ordering (column-wise)
i_colwise = 4;
% Conversion function
[jj,ii] = ind2sub([N,M],i_colwise);
i_rowwise = sub2ind([M,N],ii,jj); % This is the ordering MATLAB expects (row-wise)
  댓글 수: 2
Chakib
Chakib 2013년 8월 12일
What a pity ! :/ Thanks though !
the cyclist
the cyclist 2013년 8월 12일
편집: the cyclist 2013년 8월 12일
I included a little script (using sub2ind and ind2sub) that should convert the linear indices.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by