How to plot the function y=sin(t)/t for -4*pi<x<4*pi?

3 次查看(过去 30 天)
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.

回答(2 个)

Stephan
Stephan 2019-4-2
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
syms t
fplot(sin(t)/t,[-4*pi, 4*pi])

类别

Help CenterFile Exchange 中查找有关 Formula Manipulation and Simplification 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by