Double integrate a precise series of numbers
Show older comments
Hi All, I'm very new in Matlab and I would like to ask about this situation. I'm getting some data from my accelerometer, and I directly putting them in a file using this format:
X: 125, x: 103, Y: 127, y: 106, Z: 051, z: 043
X: 120, x: 100, Y: 129, y: 108, Z: 054, z: 045
X: 123, x: 103, Y: 127, y: 106, Z: 053, z: 044
....
X: 111, x: 093, Y: 135, y: 113, Z: 053, z: 044
I want to double integrate for example just the X axis, I know that I can use "integral2" to do that, but it needs a defined function as parameter. in my case is a set of numbers.
Note that the time is t = 1.5s, and the number of lines (readings from the accelerometer) is 78.
how can double integrate it using only this set of numbers?
Thanks in advance.
18 Comments
Star Strider
on 2 Jun 2014
Please explain: X, x, Y, y, Z, z. It’s not obvious what your data are and which ones you want to integrate.
Med
on 2 Jun 2014
José-Luis
on 2 Jun 2014
You haven't really answered Star's question...
Med
on 3 Jun 2014
José-Luis
on 3 Jun 2014
Maybe I am being dense, but it still is not clear to me. X is what? Position? Time? Moles? Apples? Oranges?
x? Position? Time? Number of remaining orang-utans?
Nowhere in your data do you show time.
Med
on 3 Jun 2014
José-Luis
on 3 Jun 2014
And what is x?
Med
on 3 Jun 2014
The double of integral of a function of a single variable makes no sense.
You can integrate f(x). A double integral of f(x) does not exist.
The double integral of f(x,y) can be found.
You only give us f(x) (if even that).
Once you have defined what you actually want, please look at
integral2() for numerical integration.
int() for symbolic integration.
Med
on 3 Jun 2014
José-Luis
on 3 Jun 2014
You cannot get a double integral from what you show.
Med
on 3 Jun 2014
Med
on 3 Jun 2014
Med
on 4 Jun 2014
José-Luis
on 4 Jun 2014
I don't know because I don't understand what you want. But if you want to obtain position and distance from the acceleration, it looks like A. Jenkins does what you want.
In that case you are not performing a double integral, you are integrating two times. That is not the same thing.
The only caveat would then be that you would need to assume a position and a speed at time t=0, if you don't know them.
Please accept A. Jenkins' answer if it helped you.
Med
on 4 Jun 2014
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!