I have an interesting problem;
I have a vector (VectorInitial). I want to calculate another vector (VectorTarget) with the same size such that the elements in VectorTarget(i)=60/VectorInitial(i).
I have tried several ways;
VectorTarget = rdivide(60,VecInitial)
VectorTarget = 60./VectorInitial
Writing a for loop to go through all the elements and divide 60 by each element 1 by 1 and write it into a new vector.
All of these methods create the same VectorTarget as expectedly. However there is a huge problem.
In my case the mean(VectorInitial) = 25.0192
60/25.0192 = 2.3982
One would expect mean(VectorTarget) to be 2.3982
However mean(VectorTarget) = 2.4863
I am really baffled as to why this is happening. Any suggestions would be highly appreciated.