Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Each language has its own concepts. An important point of this language is to very often think of matrices as an array of vectors, each column an entry. Things will start to make sense then. If you don't want that behavior, use <code>matrix(:)</code> as the argument to those functions which will pass a single vector, rather than a matrix. For example:</p> <pre><code>octave&gt; a = magic (5); octave&gt; max (a) ans = 23 24 25 21 22 octave&gt; max (a(:)) ans = 25 </code></pre> <p>1) This is not true with at least Octave 3.6.4. I'm not 100% sure but may be related related to <a href="https://savannah.gnu.org/bugs/?37411" rel="nofollow">this bug</a> which has already been fixed.</p> <p>2) If you index with boolean values, it will considered to be a mask and treated as such. If you index with non-boolean values, then it's treated as the indexes for the values. This makes perfect sense to me.</p> <p>3) This is not true. The returned has always the same size of the index, independent if it's a matrix or vector. The only exception is that if the index is a vector, the output will be a single row. The idea is that indexing with a single vector/matrix returns something of the same size:</p> <pre><code>octave&gt; a = 4:7 a = 4 5 6 7 octave&gt; a([1 1]) ans = 4 4 octave&gt; a([1 3]) ans = 4 6 octave&gt; a([1 3; 3 1]) ans = 4 6 6 4 </code></pre> <p>4) <code>max</code> does take dimension as argument at least in Octave. From the 3.6.4 help text of <code>max</code>:</p> <blockquote> <p>For a vector argument, return the maximum value. For a matrix argument, return the maximum value from each column, as a row vector, or over the dimension DIM if defined, in which case Y should be set to the empty matrix (it's ignored otherwise).</p> </blockquote> <p>The rest applies like I said on the intro. If you supply a matrix, it will think of each column as a dataset.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload