creating a pcolor plot to map coherence

조회 수: 1 (최근 30일)
Nicole Deyerl
Nicole Deyerl 2015년 6월 10일
답변: Walter Roberson 2015년 6월 11일
Hi guys, maybe you can help me out with this one. I've been racking my brain for days on this minor task. I have a bunch of random signals I created and I have data for their coherence (which is 2696 in length) with the original signal they were created from. I want to create a pcolor plot that has the frequency on the y axis and the record number (which is just from 1 to 100 on the x axis). So essentially I have the coherences, which are 2696x100 (for the 100 coherences), the frequency and the record numbers. Here is the code I had so far
if true
pcolor(ones(100,1),rand1(1:100,1:2696),cxy1(1:100,1:2696))
end
I'm getting an Index exceeds matrix dimensions error. Any tips?

답변 (1개)

Walter Roberson
Walter Roberson 2015년 6월 11일
Are you sure that you are getting "index exceeds matrix dimension" and not "matrix dimensions must agree"?
If you use a vector for X then you must also use a vector for Y. If you use a matrix for Y then you must use a matrix for X.
You may wish to use
X = ndgrid(1:size(rand1,1),1:size(X,2));
pcolor(X, rand1, cxy1);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by