Filling in the area between the two plots
1 view (last 30 days)
Show older comments
I'm trying to fill in the area between, R1 & X1, R2 and X2. How do you fill in that space, or connect the points from R1 to R2 and X1 to X2.
deg=pi/180;
r1 = 6;
r2 = 1/6;
Rc=0;
Xc=0;
theta=-98*deg:pi/100:98*deg;
R1=r1*cos(theta)+Rc;
X1=r1*sin(theta)+Xc;
R2=r2*cos(theta)+Rc;
X2=r2*sin(theta)+Xc;
plot(R1,X1,'-b'),grid % normal MHO circle
hold on
plot(R2,X2,'-b')
%plot([0 2*Rc],[0 2*Xc],'-r','LineWidth',2)
plot(alphara,alphaia, 'r')% diameter
0 Comments
Answers (1)
Star Strider
on 27 Apr 2021
Try this —
deg=pi/180;
r1 = 6;
r2 = 1/6;
Rc=0;
Xc=0;
theta=-98*deg:pi/100:98*deg;
R1=r1*cos(theta)+Rc;
X1=r1*sin(theta)+Xc;
R2=r2*cos(theta)+Rc;
X2=r2*sin(theta)+Xc;
figure
plot(R1,X1,'-b'),grid % normal MHO circle
hold on
plot(R2,X2,'-b')
patch([R1 fliplr(R2)], [X1 fliplr(X2)], 'g', 'FaceAlpha',0.5, 'EdgeColor','none')
axis('equal')
%plot([0 2*Rc],[0 2*Xc],'-r','LineWidth',2)
plot(alphara,alphaia, 'r')% diameter <— MISSING ARGUMENT VECTORS!!!
hold off
.
0 Comments
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!