Plot Problem

These commands create the expected plot:
x=.1:.1:4*pi;
y=sin(pi*x)/pi;
plot(x,y)
However, the following commands create a horizontal line at zero:
x=.1:.1:4*pi;
y=(sin(pi*x))/(pi*x);
plot(x,y)
(I don't have a sinc function.) I don't understand why the second set of commands doesn't work. Thoughts?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 28 de Sept. de 2011

0 votos

You are using mrdivide when you want to use rdivide

1 comentario

Rick
Rick el 28 de Sept. de 2011
y=(sin(pi*x))./(pi*x); gives expected plot. Thanks.

Iniciar sesión para comentar.

Más respuestas (1)

Raviteja
Raviteja el 28 de Sept. de 2011

0 votos

x=.1:.1:4*pi;
y=(sin(pi*x))./(pi*x);
plot(x,y)
Is this working?

Etiquetas

Preguntada:

el 28 de Sept. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by