"Konst " <konstance1@hotmail.com> wrote in message <k5h90f$4th$1@newscl01ah.mathworks.com>...
> I have two timeseries x and y with sampling rate 1sample/sec. I want to compute the increments of those two every 1sec (a moving window maybe but how?) and then assuming that x's increments are lying along the xaxis and y's increments along the yaxis I want to plot the angle of the resulting vector. But how can I compute the angle of a vector? I don't even know how to do it in maths. Any ideas?
Think Cartesian plot with an origin at 0,0, which is one apex of your right triangle. The x,y coordinates form another apex, with x(n),0 forming the base at the bottom of the right angle. Get it now?
If you need the angle at each point, do the basic trigonetry to get the angle. That's your answer.
If you want the mean vector, do a least squares fit, perhaps with a force to zero, a=X\Y.
This sounds a bit like a homework problem. If you want more help, show some additional effort.
Barry
