Plotting an array of vectors

조회 수: 13 (최근 30일)
Salvatore Savastano
Salvatore Savastano 2020년 2월 22일
편집: dpb 2020년 2월 22일
Hi everyone,
I'm trying to display some row of an array that represent a signal compressed after the matched filtering. Each row contains the compressed signal for the azimuth position (y-axis).
I know that with python it is possible and the result is reported below.
Is there a way to do the same with Matlab?
  댓글 수: 4
dpb
dpb 2020년 2월 22일
Can't see fig w/o download; attach an image as others.
plot() will draw lines by column of input array; those obviously had fixed offset between each dataset. Do your data have such already? If not, you'll need to introduce such.
Salvatore Savastano
Salvatore Savastano 2020년 2월 22일
Hi dpb,
I've just attached the image.
I try to be clearer: the two plots represent the a compressed signal and they appear as a sinc-function. I would like to have int the same figure their plot that don't overlap, similarly to the first figure above.
Thank you in advance.

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

답변 (2개)

darova
darova 2020년 2월 22일
편집: darova 2020년 2월 22일
Try following
h = get(gca);
% h = get(gca,'children'); % or try this
y = get(h(1),'ydata');
set(h(1),'ydata',y+50)

dpb
dpb 2020년 2월 22일
편집: dpb 2020년 2월 22일
Your data are nothing at all like that of the other figures; hence it's not surprising they don't plot similar-looking graphs.
Your data have a range of some 5-10 X 10^4 and a strong peak at one location the only real feature whereas the other data are more-or-less sinusoidal with amplitude of roughly +/-10 about the means. Hence, adding something like 30 or so to each trace separates each in it's entirety. You'd have to add
>> round(max(Y(:,1)),-2)
ans =
400
>>
to the second trace to move it to be above the first...and even then, the only thing that will show up on a linear scale will be the peak--
hL=plot(X,Y+[0 400]);
That may be all that is of interest, dunno; we have no idea of the end result wanted/needed. OTOH, if whatever else is in the noise/weeds is of any interest, then instead of adding, you'll need to multiply and use semilogy
figure
hL=semilogy(X,Y.*[1 1000]);
produces:

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by