diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 9c9ca53dd..fbc38d003 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -1447,14 +1447,16 @@ \section{Empty Arrays}\label{empty-arrays} \begin{lstlisting}[language=modelica] Real[0, m] * Real[m, n] = Real[0, n] // empty matrix Real[m, n] * Real[n, 0] = Real[m, 0] // empty matrix -Real[m, 0] * Real[0, n] = fill(0.0, m, n) // non-empty matrix of zeros +Real[m, 0] * Real[0, n] = fill(0.0, m, n) // matrix of zeros +// Note fill(0.0, m, n) will be an empty matrix if m or n is 0 \end{lstlisting} \begin{example} \begin{lstlisting}[language=modelica] -Real u[p], x[n], y[q], A[n, n], B[n, p], C[q, n], D[q, p]; -der(x) = A * x + B * u -y = C * x + D * u + Real u[p], x[n], y[q], A[n, n], B[n, p], C[q, n], D[q, p]; +equation + der(x) = A * x + B * u + y = C * x + D * u \end{lstlisting} Assume $\text{\lstinline!n!} = 0$, $\text{\lstinline!p!} > 0$, $\text{\lstinline!q!} > 0$: Results in \lstinline!y = D * u!. \end{example}