Plotting an array of vectors

26 次查看(过去 30 天)
Salvatore Savastano
编辑: 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
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 中查找有关 Graphics Performance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by