-1

I want to determine the area between the red line and the blue line but only to the y-value of 4.559. How can I achieve that?

Curve

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
MatlabNewb
  • 757
  • 1
  • 6
  • 11
  • Please [edit] your question to add the code you have to draw these lines. – Matt Jul 16 '16 at 15:55
  • It is unclear where you want to start the integration, what does the red line stands for? – EBH Jul 17 '16 at 18:23
  • 6
    @EBH We better discuss this in the optimized post --> [link](http://stackoverflow.com/questions/38421441/area-between-line-and-curve-no-function?noredirect=1#comment64255660_38421441) – MatlabNewb Jul 17 '16 at 18:30

1 Answers1

1

In general:

  • First you have to subtract the two functions from each other. After that, you have a function that represents the delta in y for each point on the x-axis.
  • After that you have to calculate the integral, for matlab you should look here Matlab - Numerical Integral
  • The last step is inserting the left, and the right bound of your desired area to calculate. The result is the area under the surface

Be careful when subtracting the functions, the result of the area might be negative (negate it in this case) if the "bigger" function is the subtrahend

vspdi
  • 11
  • 2
  • Does this work even if I do not have the function given explicitly? – MatlabNewb Jul 16 '16 at 10:13
  • In this case you should look at this question [MATLAB: integrate shade area under curve(no function)](http://stackoverflow.com/questions/37305609/matlab-integrate-and-shade-area-under-curve-no-function?rq=1) You could also try this [Integration of Numeric Data](http://de.mathworks.com/help/matlab/math/integration-of-numeric-data.html) Can you edit your querstion adding more information for those two function definitions? (example pointdata eg.) – vspdi Jul 16 '16 at 10:16