question:Recall that the RC filter has transfer function: H(f) = . For frequencies ranging from f = - 200 KHz to 200 KHz, with R = 10 K W and C = 1 m F, plot the magnitude and phase angle for the transfer function, on one plot, with the left vertical axis showing H(f), and the right vertical axis showing the phase angle, in radians .
MY answer:
C=(1/10).^6; H=(1./(1+(j*2*f*R*C)));
>> plotyy(f,abs(H),f,angle(H)); grid;
>> R=10000;
>> f=[(-200)*10.^3: 50000: (200)*10.^3];
>> C=(1/10).^6; H=(1./(1+(j*2*f*R*C)));
>> plotyy(f,abs(H),f,angle(H)); grid; xlabel('frequency');

 採用された回答

madhan ravi
madhan ravi 2018 年 10 月 13 日
編集済み: madhan ravi 2018 年 10 月 14 日

0 投票

Edited
C=(1/10).^6;
grid;
R=10000;
f=(-200)*10.^3: 50000: (200)*10.^3;
C=(1/10).^6;
H=(1./(1+(j*2*f*R*C)));
H=((1./(1+(j*2*f*R*C))));
yyaxis left
plot(f,abs(H))
hold on
yyaxis right
plot(f,angle(H))
xlabel('frequency');

6 件のコメント

Kamran Salehi
Kamran Salehi 2018 年 10 月 13 日
where do I put the code in. do I remove my plots?
madhan ravi
madhan ravi 2018 年 10 月 13 日
Yes remove plotyy(f,abs(H),f,angle(H)) and use my code instead
Kamran Salehi
Kamran Salehi 2018 年 10 月 13 日
C=(1/10).^6;
H=((1./(1+(j*2*f*R*C)));
plotyy([f,abs(H),f,angle(H)]);
grid;
R=10000;
f=[(-200)*10.^3: 50000: (200)*10.^3];
C=(1/10).^6; H=(1./(1+(j*2*f*R*C)));
yyaxis left
plot(f,abs(H))
hold on
yyaxis Right;
xlabel('frequency');
I put this and its still giving me errors. it says I have more errors but I don't know why I have errors.
madhan ravi
madhan ravi 2018 年 10 月 14 日
Check edited if it worked make sure to accept the answer
Kamran Salehi
Kamran Salehi 2018 年 10 月 15 日
thank you
madhan ravi
madhan ravi 2018 年 10 月 16 日
編集済み: madhan ravi 2018 年 10 月 16 日
you’re welcome

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2018 年 10 月 13 日

編集済み:

2018 年 10 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by