MATLAB Answers

how to color in between curves the two graphs?

9 views (last 30 days)

Answers (1)

Star Strider
Star Strider on 28 Feb 2021
It’s not possible to run images of code, especially images of incomplete code.
Try this example:
x1 = linspace(-0.1, -10, 35);
y1 = 10./x1;
x2 = linspace(-0.1, -10, 30);
y2 = 15./x2;
plot(x1, y1)
axis([-10 10 -10 10])
hold on
plot(x2, y2)
fill([x1 fliplr(x2)], [y1 fliplr(y2)],'g')
plot([0 0], ylim, '-k')
plot(xlim, [0 0], '-k')
hold off

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!