I have this code in matlab:
z = linspace(d1,d2,n)*W/t;
I am wondering how to express this operation in mathematical notation?
I was thinking of something like this
[d1 + (N).*((d2 - d1)/(n-1))]*W/t; Where N = 0,1,2,...(n-1)
But is there a fancier or more correct way or clearer way of writing this?
That is pretty much it, except that you have to multiply your vector componentwise with $\frac Wt$, so
produces a vector $v$ of dimension $n$ $$ a_k:=\left[d_1+k\left(\frac{d_2-d_1}{n-1}\right)\right]\frac Wt,k=0,\ldots,n-1 $$ in the following way $$ v\equiv(a_0,a_1,\ldots,a_{n-1}) $$