how can i shade the area between two curve
34 views (last 30 days)
Show older comments
i have two curve that intersect at two points,my aim is to calculate the area between this two curve.this is ok but on the other hand,i'd like to see this two curve in the figure,this is also ok but i don't know how i can shade the area that is between two curve.this is my program:
syms t
y1=t^2;
y2=-(t^2-16);
fg=figure;
ax=axes;
ez1=ezplot(char(y1),[-8,8]);
hold on
ez2=ezplot(char(y2),[-8,8]);
legend('y1= t^2','y2= -(t^2-16)')
set(ez1,'color',[1 0 0])
title(ax,['y1= t^2' ' y2= -(t^2-16)'])
t=solve('-(t^2-16)-t^2=0');
kokler=double(t)
alan=quad('-(t.^2-16)-t.^2',kokler(2),kokler(1))
2 Comments
Accepted Answer
bym
on 18 Aug 2011
x = linspace(kokler(1),kokler(2)); % 100 points between intersections
yy1 =x.^2; %lower function
yy2 = -(x.^2-16); % upper function
x = [x,x]; % repeat x values
yy = [yy1,yy2]; % vector of upper & lower boundaries
fill(x,yy,'b') % fill area defined by x & yy in blue
More Answers (1)
hanif
on 31 Jan 2015
I have two overlay image that intersect at two points,my aim is to calculate the area between this two curve.I don't know how to shade the area that is between two curve.this is my program:
RGB=imread('DETECTOR1.PNG');
A=imread('DETECTOR2.PNG');
F=imfuse(RGB,A,'blend','Scaling','Joint');
imwrite(RGB,'Detectors.PNG');
imtool(F);
1 Comment
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!