I have positional data captured from an LED tracker in separate matrices for x and y for series of trials. Each "trial" corresponds to one of the columns of the matrices. The columns for different trials are different lengths, depending on the size of the movement, with the remaining vector space being 0. I am looking at velocity profiles above a certain threshold speed. I combined my x and y data into a positional matrix, and took the derivative to get my velocity matrix. When I do this, the velocity profile is very noisy, so I tried to smooth it using 'loess.' My code as of now looks like this
The problem that I am having is that my vector for posdata and veldata are both longer than the raw x1s and y1s data, Am I misunderstanding how "smooth" works? Increasing the span increases size of the posdata and veldata vectors, so I am sure it is related to the smoothing.