# How to represent this matlab code in mathematical notation?

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?

• I think your notation is as clear as it gets. – Omnomnomnom Oct 22 '15 at 19:01
• So presumably you can avail yourself to the full panoply of mathematical typesetting? Something like $[d_1 + (N)\frac{d_2 - d_1}{n - 1})]{W \over t}$; Where $N = 0, 1, 2, \cdots, n - 1$ – Lisa Oct 22 '15 at 21:36

## 2 Answers

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

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.