I have an array of about 7000 data points. The data ranges from 30 to 100 in increments of 10. The data was collected using strain gauges, so the numbers have some fluctuation. I want to calculate the average for each of the set point values. I need the code to be flexible to fit other tests, so I will not necessarily know how many data points are in each section. I have attached the excel file containing the sample data. In the beginning of my code, I read the data in using the xlsread('file') function and store it as an array.
MATLAB: How to calculate a portion of the data’s average
meansort data
Related Solutions
Sorry. You seem to have a vast disconnect between your hopes for what you want to get, and the mathematics for what you can achieve, thus your plans for how you will get there.
You apparently have a list of points along some completely general surface in 3 dimensions, and the normal vector to that surface at each point. From that, you want to create "THE" curve that passes between the points, doing so by breaking it into piecewise segments where all you think you need are a pair of points and the normal vector at that point.
So, lets start with the two point question. Between ANY two points in space, there are an infinite number of paths between them. The path might follow any number of wiggles, bumps, etc. The normal vectors? Insufficient information.
Think of it like this: at each point, you have a normal vector. A point and a normal vector together define a plane. But no more than that. So now you have plane A, and a point in that plane. And somehow you need to move smoothly from point a on plane A to point B on plane B at some arbitrary other angle. There are infinitely many ways to do so.
Ok, suppose you do come up with some way to travel between the two points, then you want the "equation" that describes that path. Sadly, almost all such paths that you will draw have no explicit equation. This is a common misconception, that you can always come up with an "equation" for anything. Any set of points have an equation behind them. Nope.
So the first thing is, you have actually simplified the problem too much in a sense, in that you want to solve this in a piecewise way. Doing so actually makes the problem more complex. You need to work with the entire curve, as a spline path in 3 dimensions. (I'm not saying this is really that easy either, but at least is it doable in theory.)
What can you do easily? Well, a simple solution is to use my interparc tool (it can be found on the file exchange for download). It can take a list of points that collectively follow some path in any number of dimensions, and connect them with a smooth curve. But it does not care in the least about normal vectors, nor can it be made to do so.
Best Answer