Plotting an array of vectors

26 views (last 30 days)
Salvatore Savastano
Salvatore Savastano on 22 Feb 2020
Edited: dpb on 22 Feb 2020
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 Comments
dpb
dpb on 22 Feb 2020
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 on 22 Feb 2020
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.

Sign in to comment.

Answers (2)

darova
darova on 22 Feb 2020
Edited: darova on 22 Feb 2020
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 on 22 Feb 2020
Edited: dpb on 22 Feb 2020
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:

Categories

Find more on Graphics Performance in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!