Using Octave: Difference between revisions

4 bytes removed ,  28 October 2016
(→‎Comments: wiki markup)
(→‎Command evaluation: wiki markup)
Line 22: Line 22:


The output of every command is printed to the console unless terminated with
The output of every command is printed to the console unless terminated with
a semicolon <code>;</code>.  The <a href="https://www.gnu.org/software/octave/doc/interpreter/XREFdisp.html">disp</a> command can be used to print output
a semicolon <code>;</code>.  The [https://www.gnu.org/software/octave/doc/interpreter/XREFdisp.html disp] command can be used to print output
anywhere.  Use <a href="https://www.gnu.org/software/octave/doc/interpreter/XREFquit.html">exit</a> or <a href="https://www.gnu.org/software/octave/doc/interpreter/XREFquit.html">quit</a> to quit the console.
anywhere.  Use [https://www.gnu.org/software/octave/doc/interpreter/XREFquit.html exit] or [https://www.gnu.org/software/octave/doc/interpreter/XREFquit.html quit] to quit the console.
Read more
Read more [https://www.gnu.org/software/octave/doc/interpreter/Simple-Examples.html about command evaluation].
<a href="https://www.gnu.org/software/octave/doc/interpreter/Simple-Examples.html">about command evaluation</a>.</p><pre class="oct-code">t = 99 + 1  <span class="comment"># prints 't = 100'</span>
t = 99 + 1; <span class="comment"># nothing is printed</span>
disp(t);</pre><pre class="oct-code-output">t =  100
100
</pre>


<syntaxhighlight lang="octave">t = 99 + 1  # prints 't = 100'</syntaxhighlight>
<syntaxhighlight>t =  100</syntaxhighlight>


<syntaxhighlight lang="octave">t = 99 + 1; # nothing is printed
disp(t);</syntaxhighlight>
<syntaxhighlight> 100</syntaxhighlight>


= Elementary math =
= Elementary math =