How to fill space between two lines?
7 views (last 30 days)
Show older comments
Lukasz Skowron
on 17 Jan 2019
Commented: Star Strider
on 17 Jan 2019
Hi, I have this code:
H_up = [0,cosd(80)*7.387/10,cosd(70)*7.985/10,cosd(60)*8.906/10,cosd(50)*1.025,cosd(40)*1.238,cosd(30)*1.155,cosd(20)*1.064,cosd(10)*1.015,1];
H_lo = [0,cosd(80)*7.243/10,cosd(70)*7.826/10,cosd(60)*8.734/10,cosd(50)*1.009,cosd(40)*1.218,cosd(30)*1.137,cosd(20)*1.062,cosd(10)*1.015,1];
M_up = [7.021/10,sind(80)*7.387/10,sind(70)*7.985/10,sind(60)*8.906/10,sind(50)*1.025,sind(40)*1.238,sind(30)*1.155,sind(20)*1.064,sind(10)*1.015,0];
M_lo = [6.897/10,sind(80)*7.243/10,sind(70)*7.826/10,sind(60)*8.734/10,sind(50)*1.009,sind(40)*1.218,sind(30)*1.137,sind(20)*1.062,sind(10)*1.015,0];
plot(H_up,M_up)
hold on
plot(H_lo,M_lo)
I would like to fill space between those lines with some color, say light-blue. How to do that?
Thanks,
Lukasz
0 Comments
Accepted Answer
Star Strider
on 17 Jan 2019
Try this:
H_up = [0,cosd(80)*7.387/10,cosd(70)*7.985/10,cosd(60)*8.906/10,cosd(50)*1.025,cosd(40)*1.238,cosd(30)*1.155,cosd(20)*1.064,cosd(10)*1.015,1];
H_lo = [0,cosd(80)*7.243/10,cosd(70)*7.826/10,cosd(60)*8.734/10,cosd(50)*1.009,cosd(40)*1.218,cosd(30)*1.137,cosd(20)*1.062,cosd(10)*1.015,1];
M_up = [7.021/10,sind(80)*7.387/10,sind(70)*7.985/10,sind(60)*8.906/10,sind(50)*1.025,sind(40)*1.238,sind(30)*1.155,sind(20)*1.064,sind(10)*1.015,0];
M_lo = [6.897/10,sind(80)*7.243/10,sind(70)*7.826/10,sind(60)*8.734/10,sind(50)*1.009,sind(40)*1.218,sind(30)*1.137,sind(20)*1.062,sind(10)*1.015,0];
plot(H_up,M_up)
hold on
plot(H_lo,M_lo)
patch([H_up fliplr(H_lo)], [M_up fliplr(M_lo)], [0.6 0.8 1.0])
hold off
2 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!