绘制惠斯通电桥电路的输出电压
Plotting output voltages from a Wheatstone Bridge Circuit
为什么我的绘图从原点到主曲线都有这些线?我正在绘制惠斯通电桥电路的输出电压,其中上线和下线代表电阻容差引起的差异。
这是我的代码:
A=13.5;
R1=40;
R2=40;
R3=40;
R4=40;
Vref=5;
Vout1=zeros(size(0:0.01:0.25));
Vout2=zeros(size(0:0.01:0.25));
Vout3=zeros(size(0:0.01:0.25));
avector=zeros(size(0:0.01:0.25));
n=0;
for a=0:0.01:0.35
n=n+1;
avector(1,n)=a;
Vout1(1,n)=(A*a*Vref)/(4*(1+a/2));
Vout2(1,n)=(A*Vref)*(((1.01*R1)/(1.01*R1+0.99*R2))-((0.99*R3)/(0.99*R3+(1+a)*1.01*R4)));
Vout3(1,n)=(A*Vref)*(((0.99*R1)/(0.99*R1+1.01*R2))-((1.01*R3)/(1.01*R3+(1+a)*0.99*R4)));
plot(avector,Vout1)
hold on
plot(avector,Vout2)
hold on
plot(avector,Vout3)
end
您应该将行 hold off
添加到循环的末尾以重置轴属性,否则 MATLAB 将尝试连接从 Vout1 的起点到 Vout1、Vout2 和 Vout3 中的每个点的所有内容
A=13.5;
R1=40;
R2=40;
R3=40;
R4=40;
Vref=5;
Vout1=zeros(size(0:0.01:0.25));
Vout2=zeros(size(0:0.01:0.25));
Vout3=zeros(size(0:0.01:0.25));
avector=zeros(size(0:0.01:0.25));
n=0;
for a=0:0.01:0.35
n=n+1;
avector(1,n)=a;
Vout1(1,n)=(A*a*Vref)/(4*(1+a/2));
Vout2(1,n)=(A*Vref)*(((1.01*R1)/(1.01*R1+0.99*R2))-((0.99*R3)/(0.99*R3+(1+a)*1.01*R4)));
Vout3(1,n)=(A*Vref)*(((0.99*R1)/(0.99*R1+1.01*R2))-((1.01*R3)/(1.01*R3+(1+a)*0.99*R4)));
plot(avector,Vout1)
hold on
plot(avector,Vout2)
plot(avector,Vout3)
% add this line
hold off
end
为什么我的绘图从原点到主曲线都有这些线?我正在绘制惠斯通电桥电路的输出电压,其中上线和下线代表电阻容差引起的差异。
A=13.5;
R1=40;
R2=40;
R3=40;
R4=40;
Vref=5;
Vout1=zeros(size(0:0.01:0.25));
Vout2=zeros(size(0:0.01:0.25));
Vout3=zeros(size(0:0.01:0.25));
avector=zeros(size(0:0.01:0.25));
n=0;
for a=0:0.01:0.35
n=n+1;
avector(1,n)=a;
Vout1(1,n)=(A*a*Vref)/(4*(1+a/2));
Vout2(1,n)=(A*Vref)*(((1.01*R1)/(1.01*R1+0.99*R2))-((0.99*R3)/(0.99*R3+(1+a)*1.01*R4)));
Vout3(1,n)=(A*Vref)*(((0.99*R1)/(0.99*R1+1.01*R2))-((1.01*R3)/(1.01*R3+(1+a)*0.99*R4)));
plot(avector,Vout1)
hold on
plot(avector,Vout2)
hold on
plot(avector,Vout3)
end
您应该将行 hold off
添加到循环的末尾以重置轴属性,否则 MATLAB 将尝试连接从 Vout1 的起点到 Vout1、Vout2 和 Vout3 中的每个点的所有内容
A=13.5;
R1=40;
R2=40;
R3=40;
R4=40;
Vref=5;
Vout1=zeros(size(0:0.01:0.25));
Vout2=zeros(size(0:0.01:0.25));
Vout3=zeros(size(0:0.01:0.25));
avector=zeros(size(0:0.01:0.25));
n=0;
for a=0:0.01:0.35
n=n+1;
avector(1,n)=a;
Vout1(1,n)=(A*a*Vref)/(4*(1+a/2));
Vout2(1,n)=(A*Vref)*(((1.01*R1)/(1.01*R1+0.99*R2))-((0.99*R3)/(0.99*R3+(1+a)*1.01*R4)));
Vout3(1,n)=(A*Vref)*(((0.99*R1)/(0.99*R1+1.01*R2))-((1.01*R3)/(1.01*R3+(1+a)*0.99*R4)));
plot(avector,Vout1)
hold on
plot(avector,Vout2)
plot(avector,Vout3)
% add this line
hold off
end