How fill area between curves with limits?

1 view (last 30 days)
Jose Polanco
Jose Polanco on 19 Nov 2015
Edited: Walter Roberson on 19 Nov 2015
Hi, I'm doing an area between curves calculator,I'm almost finishing, what i need right now is to fill (with shade or color) the area, right now I fill the area between two curves but without limits,lets assume the next its a part of my whole code (I say assume because the user needs to input the two curves and the limits)
syms x
t=solve('x-(x^3)=0',x); %function1 was x and second was x^3
kokler=double(t);
[m,w]=size(t);
x = linspace(kokler(w),kokler(m));
yy1 =x.^3;
yy2 = x;
x = [x,x]; % repeat x values
yy = [yy1,yy2]; % vector of upper & lower boundaries
ezplot(yy4); hold on
ezplot(yy3);
fill(x,yy,'b'); % fill area
And it works fine with area between intercepts, but what can i do if the user says the limits are -5 to 5, i need to graficate that area two and found the total value Integral (which i think i know how to do), that will be something like this https://www.wolframalpha.com/input/?i=find+the+area+between+x%5E3+and+x+from+-5+to+5 , could you give me ideas? Thank u really much

Answers (0)

Categories

Find more on Loops and Conditional Statements 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!