plot 2d color graph

조회 수: 11 (최근 30일)
avantika
avantika 2012년 11월 7일
I want to plot a 2d plot in which x-axis represent the stimulus number , y- axis is subdivided into 8 sub-parts and the scale of each sub-part is from 0-4. The values are defined with a color map ranging from 0-4 such that for each x value , the values are plotted along each of the sub-parts of y-axis according to the color code.
Pls answer.
  댓글 수: 1
avantika
avantika 2012년 11월 7일
can anybody answer which command should i use in matlab?

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

답변 (1개)

Grzegorz Knor
Grzegorz Knor 2012년 11월 7일
In my opinion you should use the imagesc function.
x = 1:10;% 10 stimulus
y = 1:8;% 8 subparts
z = randi(5,8,10)-1;% random value from 0 to 4
imagesc(x,y,z)
colormap(jet(5))

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by