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

조회 수: 7 (최근 30일)
CCF2017 MIT
CCF2017 MIT 2019년 4월 2일
답변: Shubham Kumar Thakur 2020년 12월 7일
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
Shubham Kumar Thakur 2020년 12월 7일
syms t
fplot(sin(t)/t,[-4*pi, 4*pi])

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by