I'm trying to caluclate the area between the curves from about x=-0.22 and 4 as the intersection happens about in those two places. However having trouble using fzero to find the correct intersects and using "integral" to calculate the area.
clear, clc, clear plotformat shortg=@(x)exp((-x.^2)./2);h=@(x) x.^2-4.*x;x=linspace(-1,5,100);plot(x,g(x));hold onplot(x,h(x));z(1)=fzero(g,-0.22); % dont know how to use
z(2)=fzero(h,4); % dont know how to use
% integral
a=z(1);b=z(2);f=@(x) % dont know how to useq=integral(f,a,b)
Best Answer