フィルターのクリア

Plotting The Amplitude for Fourier Series Coefficients

3 ビュー (過去 30 日間)
Salik Mallick
Salik Mallick 2020 年 10 月 1 日
コメント済み: Ameer Hamza 2020 年 10 月 1 日
%% Problem 1
display('Problem 1')
syms n t
Wo = pi;
T = 2;
n = 1:10;
a0=(1/T)*(int(t,t,0,1))
an= (2/T)*(int(t*cos(n*Wo*t),0,1))
bn=(2/T)*(int(t*sin(n*Wo*t),0,1))

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 10 月 1 日
Something like this
syms n t
Wo = pi;
T = 2;
n = 1:10;
a0 = (1/T)*int(t,t,0,1);
an = (2/T)*int(t*cos(n*Wo*t),0,1);
bn = (2/T)*int(t*sin(n*Wo*t),0,1);
subplot(2,1,1)
title('an');
stem(0:10, [a0 an])
subplot(2,1,2)
title('bn');
stem(1:10, bn)
  2 件のコメント
Salik Mallick
Salik Mallick 2020 年 10 月 1 日
Thank you, but how do I plot the actual function?
Ameer Hamza
Ameer Hamza 2020 年 10 月 1 日
Following plot actual function
syms n t
Wo = pi;
T = 2;
n = 1:10;
a0 = (1/T)*int(t,t,0,1);
an = (2/T)*int(t*cos(n*Wo*t),0,1);
bn = (2/T)*int(t*sin(n*Wo*t),0,1);
t = linspace(0, 1);
x = zeros(size(t));
x(:) = a0;
for i = 1:numel(an)
x = x + an(i)*cos(Wo*i*t) + bn(i)*sin(Wo*i*t);
end
plot(t, x)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by