nts are legal.</p>
<pre class="stan"><code>b = a[1];       // result is array of vectors
c = a[1, 3];    // result is vector
c = b[3];       //   same result as above
x = a[1, 3, 5]; // result is scalar
x = b[3, 5];    //   same result as above
x = c[5];       //   same result as above</code></pre>
<p>Row vectors and other derived vector types (simplex and ordered)
behave the same way in terms of indexing.</p>
<p>Consider the following matrix, vector and scalar declarations.</p>
<pre class="stan"><code>arra