How I have all three error bars in one figure
1 次查看(过去 30 天)
显示 更早的评论
R1=10
R2=27
R3=10
Rtotalseries=R1+R2+R3
Vs=5
Itotal=Vs./Rtotalseries
V1=(Vs./Rtotalseries).*R1
V2=(Vs./Rtotalseries).*R2
V3=(Vs./Rtotalseries).*R3
V1measured=1.058
V2measured=2.875
V3measured=1.063
V1percenterror=((abs(V1-V1measured)./V1))*100
V2percenterror=((abs(V2-V2measured)./V2))*100
V3percenterror=((abs(V3-V3measured)./V3))*100
errorbar(V1,V1measured,V1percenterror)
errorbar(V2,V2measured,V2percenterror)
errorbar(V3,V3measured,V3percenterror)
=> I'm trying to get all three error bar codes in a single plot figure
0 个评论
回答(2 个)
Star Strider
2024-1-29
R1=10
R2=27
R3=10
Rtotalseries=R1+R2+R3
Vs=5
Itotal=Vs./Rtotalseries
V1=(Vs./Rtotalseries).*R1
V2=(Vs./Rtotalseries).*R2
V3=(Vs./Rtotalseries).*R3
V1measured=1.058
V2measured=2.875
V3measured=1.063
V1percenterror=((abs(V1-V1measured)./V1))*100
V2percenterror=((abs(V2-V2measured)./V2))*100
V3percenterror=((abs(V3-V3measured)./V3))*100
figure
hold on
errorbar(V1,V1measured,V1percenterror)
errorbar(V2,V2measured,V2percenterror)
errorbar(V3,V3measured,V3percenterror)
hold off
Make appropriate changes to get the result you want.
.
0 个评论
Walter Roberson
2024-1-29
R1=10
R2=27
R3=10
Rtotalseries=R1+R2+R3
Vs=5
Itotal=Vs./Rtotalseries
V1=(Vs./Rtotalseries).*R1
V2=(Vs./Rtotalseries).*R2
V3=(Vs./Rtotalseries).*R3
V1measured=1.058
V2measured=2.875
V3measured=1.063
V1percenterror=((abs(V1-V1measured)./V1))*100
V2percenterror=((abs(V2-V2measured)./V2))*100
V3percenterror=((abs(V3-V3measured)./V3))*100
errorbar(V1,V1measured,V1percenterror)
hold on
errorbar(V2,V2measured,V2percenterror)
errorbar(V3,V3measured,V3percenterror)
hold off
The third error bar is so close to the first error bar that it is easy to confuse them.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!