Skip to content

Commit

Permalink
Use math also for the 'x1' and 'x2' of linspace
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 17, 2020
1 parent 223d09f commit 59e5204
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ \subsection{Specialized Array Constructor Functions}\doublelabel{specialized-arr
\lstinline[mathescape=true]!fill(s, $n$)! = \lstinline[mathescape=true]!{s, s, $\ldots$, s}!

The function needs two or more arguments; that is \lstinline!fill(s)! is not legal.\\ \hline
\lstinline[mathescape=true]!linspace(x1, x2, $n$)!
\lstinline[mathescape=true]!linspace($x_{1}$, $x_{2}$, $n$)!
&
Returns a \lstinline!Real! vector with $n$ equally spaced elements, such that
\lstinline[mathescape=true]!v = linspace(x1, x2, $n$)! results in
\lstinline[mathescape=true]!v[$i$] = x1 + (x2-x1)*($i$-1)/($n$-1)! for $1 \leq i \leq n$.
It is required that $n \geq 2$. The arguments \lstinline!x1! and \lstinline!x2! shall
be numeric scalar expressions.\\ \hline
Returns a \lstinline!Real! vector with $n$ equally spaced elements, such that \lstinline[mathescape=true]!v = linspace($x_{1}$, $x_{2}$, $n$)! results in
\begin{equation*}
\text{\lstinline[mathescape=true]!v[$i$]!} = x_{1} + (x_{2} - x_{1}) \frac{i - 1}{n - 1} \quad \text{for $1 \leq i \leq n$}
\end{equation*}
It is required that $n \geq 2$. The arguments $x_{1}$ and $x_{2}$ shall be numeric scalar expressions.\\ \hline
\end{longtable}

\subsection{Reduction Functions and Operators}\doublelabel{reduction-functions-and-operators}
Expand Down

0 comments on commit 59e5204

Please sign in to comment.