How to plot the function y=sin(t)/t for -4*pi<x<4*pi?
Mostrar comentarios más antiguos
I m having trouble finding the plot for this function in matlab, with no plot as a result. I tried the following code.
clear;clc;clf;
t=-4*pi : 0.01 : 4*pi;
y=sin(t)/t;
plot(t,y)
but i m not getting output.
1 comentario
Torsten
el 2 de Abr. de 2019
y=sin(t)./t;
Respuestas (2)
Stephan
el 2 de Abr. de 2019
Hi,
at least two ways possible:
- Symbolic:
syms t
fplot(sin(t)/t,[-4*pi, 4*pi])
- Numeric:
t = linspace(-4*pi,4*pi);
y = sin(t)./t;
plot(t,y)
Therefore - as Torsten aready mentioned - use elementwise operator:
./
Best regards
Stephan
Shubham Kumar Thakur
el 7 de Dic. de 2020
0 votos
syms t
fplot(sin(t)/t,[-4*pi, 4*pi])
Categorías
Más información sobre 2-D and 3-D Plots 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!