how do i plot the output vo against frequency ? i tried out however my graph seems weird thank you in advance
2 ビュー (過去 30 日間)
古いコメントを表示
Av=1+(Rf/Ri_minus);
Vo= (1+(Rf/Ri_minus))*Vin;
Vonew=subs(Vo,{Rf,Ri_minus,Vin},{10,20,30})
f = 50 %Hz
% x = linspace(0, 2*pi, 1000);
y = Vonew* sin((2 * pi * f/1000*(0:19))); %sample time sie of 1000,20x [0:19] 1 time period
plot( y, 'b-', 'LineWidth', 2);
xlabel('time', 'FontSize', 20);
ylabel('vo', 'FontSize', 20);
title('vo vs time', 'FontSize', 20);
this is my codes however the graph seems a little weird
thank you inadvance
0 件のコメント
回答 (1 件)
VBBV
2022 年 2 月 14 日
編集済み: VBBV
2022 年 2 月 14 日
% Rf = 1.1;
% Ri_minus = 0.2;
% Vin = 10;
syms Rf Ri_minus Vin
Av=1+(Rf/Ri_minus);
Vo= (1+(Rf/Ri_minus))*Vin;
Vonew=subs(Vo,[Rf,Ri_minus,Vin],[10,20,30])
f = 50; %Hz
% x = linspace(0, 2*pi, 1000);
y = Vonew* sin((2 * pi * f/1000*(0:19))); %sample time sie of 1000,20x [0:19] 1 time period
plot(y, 'b-', 'LineWidth', 2);
xlabel('time', 'FontSize', 20);
ylabel('vo', 'FontSize', 20);
title('vo vs time', 'FontSize', 20);
f = linspace(20,100,length(0:19)); %Hz
% x = linspace(0, 2*pi, 1000);
y = Vonew* sin((2 * pi * f./1000.*(0:19))); %sample time sie of 1000,20x [0:19] 1 time period
figure(2)
plot(f,y, 'b-', 'LineWidth', 2);
xlabel('frequency', 'FontSize', 20);
ylabel('vo', 'FontSize', 20);
title('vo vs frequency ', 'FontSize', 20);
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!