Can you help me plz?(discrete plot)

조회 수: 1 (최근 30일)
Jin You
Jin You 2020년 5월 27일
편집: Nishant Gupta 2020년 5월 29일
Hello, everyone.
I'm asking you this question because I'm having trouble drawing discrete graphs while solving Fourier water problems.
I needed only one cycle to Fourier series, so I made a single square pulse and made an integral part to Fourier series.
Here, n is supposed to take an integer and create a discrete sinc function, but I'm not sure how to set it.
Can you help me? :(
clear;
close all;
clc;
%To get Fourier series, only one cycle of pulse wave is needed.
%So, draw a pulse waveform of one cycle again and take a Fourier series.
syms t
n=interger; %i need help :(
T=2; %period
w=2*pi/T;
y(t)=rectangularPulse(t); %pulse
F(n)=y(t)*exp(-1i*w*n*t);
cn=int(F(n),t,-0.5,0.5)/T;
Tcn=T*cn;
fplot(n, Tcn)
I want you to look like this picture.

답변 (1개)

Nishant Gupta
Nishant Gupta 2020년 5월 29일
편집: Nishant Gupta 2020년 5월 29일
Instead of using fplot, try using stem function to plot discrete data.
syms t
n=1:50;
T=2; %period
w=2*pi/T;
y(t)=rectangularPulse(t); %pulse
F(n)=y(t)*exp(-1i*w*n*t);
cn=int(F(n),t,-0.5,0.5)/T;
Tcn=T*cn;
stem(n,Tcn)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by