Question: Is there a better way to code up this vector


I have coded up a vector that is of my interest. The code runs witout any problem and gives me exactly what I want.

All I want to know, is that if there are more efficient way to do so?

Any tricks, or better use of a particular function that I wasn't aware?

The only tiny bit of unsatisfactory is that, the (1-w) term is at the first term of the addition, is that possible to move it to the last term? Which is more conventional to read.





Please Wait...