MATLAB: Average Position vs Time Graph

averagegraphplotspline

I need to make a position vs time graph with data collected from a subject during walking. I have two variables, 'position' and 'time.' They are both matrices, with the position/time data from each step in its own column (position(x,y) corisponds to time(x,y)). The steps very in duration and the number of postion measurements. I normalized the time so that all steps are the same length. Right now I can produce ~30 lines showing each individual step. I need to average the data and create one line representing all the steps. Whats the best way to do this? I was told to use the spline function to create the graph but having trouble. Thanks ~Dan

Best Answer

You have 2D data, but you have not indicated which dimension you wish to average over.
It is not apparently to me why the arrays are 2D for a single subject? If multiple subjects were involved, that would make sense.
Is this really a question about producing "one line" by averaging, or is it a question about producing a smooth line from a list of (X,Y) positions? Producing one line by averaging has no immediately obvious connection to splines.
Related Question