mhmhsh
mhmhsh

Reputation: 161

solve for a parameter such that area under curve equals 1

I have just found that I can use the function trapz in Matlab to find the area under a curve given a vector. What I want to do is to normalize the values in this vector in such that the area under the curve equals 1. let's say that x is a single scaling factor such that:

Area_Under_curve(x * V) = 1

How can I find x?

Upvotes: 0

Views: 569

Answers (1)

Rody Oldenhuis
Rody Oldenhuis

Reputation: 38042

I think

x = 1/trapz(V)

will do just that :)

Upvotes: 2

Related Questions