How do I get the value under the curve?

Hello,
I want know the value under a specific curve I have. I have already tried the command: area
But I want to know the exact value under the entire curve, I dont know which command(s) I have to use to get to this answer.
Can someone help me with this?
This is the script I am using.
Thanks in advance

5 Comments

doc cumsum
doc trapz
doc cumtrapz
One of those should be able to help with what you want. I don't remember off-hand what each does specifically different to each other, but they can all be used for those type of problems.
Thanks for your reply,
I tried them but only got errors, I dont know how to correctly setup those commands, the data from the curve above, are the ones from: tijdSEC and fuelconsumptionsGS. Thats the only curve where I need to know the area underneath it.
Can you help me setting up the command correctly?
It's a long time since I've used them, but the help on each gives an example that you should be able to adapt.
I tried them but only got errors
What kind of errors do you have?
Sorry for my late response.
I got errors for NaN, then I found a way how to fix that issue.
In the end I found the area under the curve with trapz.

Answers (1)

Hi
There is a similar question asked in the community. You can refer to the following link:

This question is closed.

Asked:

HV
on 19 Sep 2019

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!