how do i plot the output vo against frequency ? i tried out however my graph seems weird thank you in advance
20 次查看(过去 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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!