Why is line does not showing up on the plot?
Mostrar comentarios más antiguos
I'm trying to plot a line but it's not working. Here's an example of what doesn't work:
c = 3*10^8;
f0 = 10^9;
Vtarget = 10;
Vradar = 0;
fd = 2*(Vradar - Vtarget).*f0./c;
t= 0:100;
plot(t,fd)
title('Doppler Frequency Change')
xlabel('Time(sec)')
ylabel('Doppler Frequency(Hertz)')

Respuesta aceptada
Más respuestas (1)
Cris LaPierre
el 13 de Nov. de 2020
Editada: Cris LaPierre
el 13 de Nov. de 2020
Because fd contains a single value. This defines a point, not a line. Therefore, your code plots a single point at each t value, but they are not connected. You can see this by adding a line format spec that includes a marker to your plot command.
c = 3*10^8;
f0 = 10^9;
Vtarget = 10;
Vradar = 0;
fd = 2*(Vradar - Vtarget).*f0./c;
t= 0:100;
plot(t,fd,'r-o')
Categorías
Más información sobre Digital Filter Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
