How to represent this matlab code in mathematical notation?

273 Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

That is pretty much it, except that you have to multiply your vector componentwise with $\frac Wt$, so

z = linspace(d1,d2,n)*W/t

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}) $$

0
On

It depends on the context, but I would write it as,

$$ z = \left\{ \frac{W\cdot d_1}{t}, \frac{W\cdot d_1 + W\cdot(d_2-d_1)/(n-1)}{t}, \cdots, \frac{W\cdot d_2}{t} \right\} $$ which is easier to understand than giving an explicit series.