How can I fill the area between these lines and curves?

7 views (last 30 days)
x=0, x=4, y=sqrt(x), y=2
I have coded like this, but it fill the wrong area
x=0:0.01:4;
y=sqrt(x);
area(x,y)
How can I fill this area correctly?
  1 Comment
Image Analyst
Image Analyst on 21 May 2023
Your edit indicates you did not look at the FAQ and even try to adapt your code. Why not?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 21 May 2023
  2 Comments
Image Analyst
Image Analyst on 22 May 2023
Since this Answer solved your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.

Sign in to comment.

More Answers (1)

the cyclist
the cyclist on 21 May 2023
You can use the fill function.

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!