Calculating the average curve from a set of curves
3 views (last 30 days)
Show older comments
Hi, I am trying to create a pressure vs volume graph using Labview for data acquisition and importing the data to Matlab.
I was able to import the data to Matlab, but my graph looks like a sin wave that keeps oscillating. I am trying to calculate the area under the curve using the trapz function, but I would like to create a graph with only one curve representing the average of all the curves.
I thought of averaging the corresponding "y" points, but every cycle on the graph has a different amount of points so it is not possible to create a simple average program using Matlab. Also, I have used the cftool function, but it does not help me with creating just one graph. Can anyone please give some advice or any tips that can help me calculate the average curve of a set of curves?
Thank you.
Edit [01 Aug 2012, 18:15 BST - OK] Added data sample from comment
Here is a set of data:
x = [5.1373
5.1473
5.1573
5.1673
5.1773
5.1873
5.1973
5.2073]
y = [17.6690
31.3300
43.8985
51.3575
53.8226
51.1592
40.9826
22.4972
6.3214
8.8891
29.2098
47.2177
53.7129]
where x is time in seconds and y is volume.
2 Comments
Answers (1)
Image Analyst
on 31 Jul 2012
If the phase of all the sine waves matched up, and you can determine a starting and ending point, then maybe you can use interp1() to get them all to have values for the same set of x values.
0 Comments
See Also
Categories
Find more on Interpolation 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!