/usr/share/doc/octave/octave.html/Terminal-Output.html is in octave-doc 4.2.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Terminal Output (GNU Octave)</title>
<meta name="description" content="Terminal Output (GNU Octave)">
<meta name="keywords" content="Terminal Output (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Basic-Input-and-Output.html#Basic-Input-and-Output" rel="up" title="Basic Input and Output">
<link href="Paging-Screen-Output.html#Paging-Screen-Output" rel="next" title="Paging Screen Output">
<link href="Basic-Input-and-Output.html#Basic-Input-and-Output" rel="prev" title="Basic Input and Output">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<a name="Terminal-Output"></a>
<div class="header">
<p>
Next: <a href="Terminal-Input.html#Terminal-Input" accesskey="n" rel="next">Terminal Input</a>, Up: <a href="Basic-Input-and-Output.html#Basic-Input-and-Output" accesskey="u" rel="up">Basic Input and Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Terminal-Output-1"></a>
<h4 class="subsection">14.1.1 Terminal Output</h4>
<p>Since Octave normally prints the value of an expression as soon as it
has been evaluated, the simplest of all I/O functions is a simple
expression. For example, the following expression will display the
value of ‘<samp>pi</samp>’
</p>
<div class="example">
<pre class="example">pi
-| pi = 3.1416
</pre></div>
<p>This works well as long as it is acceptable to have the name of the
variable (or ‘<samp>ans</samp>’) printed along with the value. To print the
value of a variable without printing its name, use the function
<code>disp</code>.
</p>
<p>The <code>format</code> command offers some control over the way Octave prints
values with <code>disp</code> and through the normal echoing mechanism.
</p>
<a name="XREFdisp"></a><dl>
<dt><a name="index-disp"></a>: <em></em> <strong>disp</strong> <em>(<var>x</var>)</em></dt>
<dt><a name="index-disp-1"></a>: <em><var>str</var> =</em> <strong>disp</strong> <em>(<var>x</var>)</em></dt>
<dd><p>Display the value of <var>x</var>.
</p>
<p>For example:
</p>
<div class="example">
<pre class="example">disp ("The value of pi is:"), disp (pi)
-| the value of pi is:
-| 3.1416
</pre></div>
<p>Note that the output from <code>disp</code> always ends with a newline.
</p>
<p>If an output value is requested, <code>disp</code> prints nothing and returns the
formatted output in a string.
</p>
<p><strong>See also:</strong> <a href="Simple-File-I_002fO.html#XREFfdisp">fdisp</a>.
</p></dd></dl>
<a name="XREFlist_005fin_005fcolumns"></a><dl>
<dt><a name="index-list_005fin_005fcolumns"></a>: <em></em> <strong>list_in_columns</strong> <em>(<var>arg</var>, <var>width</var>, <var>prefix</var>)</em></dt>
<dd><p>Return a string containing the elements of <var>arg</var> listed in columns with
an overall maximum width of <var>width</var> and optional prefix <var>prefix</var>.
</p>
<p>The argument <var>arg</var> must be a cell array of character strings or a
character array.
</p>
<p>If <var>width</var> is not specified or is an empty matrix, or less than or equal
to zero, the width of the terminal screen is used. Newline characters are
used to break the lines in the output string. For example:
</p>
<div class="smallexample">
<pre class="smallexample">list_in_columns ({"abc", "def", "ghijkl", "mnop", "qrs", "tuv"}, 20)
⇒ abc mnop
def qrs
ghijkl tuv
whos ans
⇒
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x37 37 char
Total is 37 elements using 37 bytes
</pre></div>
<p><strong>See also:</strong> <a href="#XREFterminal_005fsize">terminal_size</a>.
</p></dd></dl>
<a name="XREFterminal_005fsize"></a><dl>
<dt><a name="index-terminal_005fsize"></a>: <em></em> <strong>terminal_size</strong> <em>()</em></dt>
<dd><p>Return a two-element row vector containing the current size of the terminal
window in characters (rows and columns).
</p>
<p><strong>See also:</strong> <a href="#XREFlist_005fin_005fcolumns">list_in_columns</a>.
</p></dd></dl>
<a name="XREFformat"></a><dl>
<dt><a name="index-format"></a>: <em></em> <strong>format</strong></dt>
<dt><a name="index-format-1"></a>: <em></em> <strong>format</strong> <em>options</em></dt>
<dd><p>Reset or specify the format of the output produced by <code>disp</code> and
Octave’s normal echoing mechanism.
</p>
<p>This command only affects the display of numbers but not how they are stored
or computed. To change the internal representation from the default double
use one of the conversion functions such as <code>single</code>, <code>uint8</code>,
<code>int64</code>, etc.
</p>
<p>By default, Octave displays 5 significant digits in a human readable form
(option ‘<samp>short</samp>’ paired with ‘<samp>loose</samp>’ format for matrices).
If <code>format</code> is invoked without any options, this default format
is restored.
</p>
<p>Valid formats for floating point numbers are listed in the following
table.
</p>
<dl compact="compact">
<dt><code>short</code></dt>
<dd><p>Fixed point format with 5 significant figures in a field that is a maximum
of 10 characters wide. (default).
</p>
<p>If Octave is unable to format a matrix so that columns line up on the
decimal point and all numbers fit within the maximum field width then
it switches to an exponential ‘<samp>e</samp>’ format.
</p>
</dd>
<dt><code>long</code></dt>
<dd><p>Fixed point format with 15 significant figures in a field that is a maximum
of 20 characters wide.
</p>
<p>As with the ‘<samp>short</samp>’ format, Octave will switch to an exponential
‘<samp>e</samp>’ format if it is unable to format a matrix properly using the
current format.
</p>
</dd>
<dt><code>short e</code></dt>
<dt><code>long e</code></dt>
<dd><p>Exponential format. The number to be represented is split between a
mantissa and an exponent (power of 10). The mantissa has 5 significant
digits in the short format and 15 digits in the long format. For example,
with the ‘<samp>short e</samp>’ format, <code>pi</code> is displayed as
<code>3.1416e+00</code>.
</p>
</dd>
<dt><code>short E</code></dt>
<dt><code>long E</code></dt>
<dd><p>Identical to ‘<samp>short e</samp>’ or ‘<samp>long e</samp>’ but displays an uppercase
‘<samp>E</samp>’ to indicate the exponent.
For example, with the ‘<samp>long E</samp>’ format, <code>pi</code> is displayed as
<code>3.14159265358979E+00</code>.
</p>
</dd>
<dt><code>short g</code></dt>
<dt><code>long g</code></dt>
<dd><p>Optimally choose between fixed point and exponential format based on
the magnitude of the number.
For example, with the ‘<samp>short g</samp>’ format,
<code>pi .^ [2; 4; 8; 16; 32]</code> is displayed as
</p>
<div class="example">
<pre class="example">ans =
9.8696
97.409
9488.5
9.0032e+07
8.1058e+15
</pre></div>
</dd>
<dt><code>short eng</code></dt>
<dt><code>long eng</code></dt>
<dd><p>Identical to ‘<samp>short e</samp>’ or ‘<samp>long e</samp>’ but displays the value
using an engineering format, where the exponent is divisible by 3. For
example, with the ‘<samp>short eng</samp>’ format, <code>10 * pi</code> is displayed as
<code>31.4159e+00</code>.
</p>
</dd>
<dt><code>long G</code></dt>
<dt><code>short G</code></dt>
<dd><p>Identical to ‘<samp>short g</samp>’ or ‘<samp>long g</samp>’ but displays an uppercase
‘<samp>E</samp>’ to indicate the exponent.
</p>
</dd>
<dt><code>free</code></dt>
<dt><code>none</code></dt>
<dd><p>Print output in free format, without trying to line up columns of
matrices on the decimal point. This also causes complex numbers to be
formatted as numeric pairs like this ‘<samp>(0.60419, 0.60709)</samp>’ instead
of like this ‘<samp>0.60419 + 0.60709i</samp>’.
</p></dd>
</dl>
<p>The following formats affect all numeric output (floating point and
integer types).
</p>
<dl compact="compact">
<dt><code>"+"</code></dt>
<dt><code>"+" <var>chars</var></code></dt>
<dt><code>plus</code></dt>
<dt><code>plus <var>chars</var></code></dt>
<dd><p>Print a ‘<samp>+</samp>’ symbol for matrix elements greater than zero, a
‘<samp>-</samp>’ symbol for elements less than zero and a space for zero matrix
elements. This format can be very useful for examining the structure
of a large sparse matrix.
</p>
<p>The optional argument <var>chars</var> specifies a list of 3 characters to use
for printing values greater than zero, less than zero and equal to zero.
For example, with the ‘<samp>"+" "+-."</samp>’ format,
<code>[1, 0, -1; -1, 0, 1]</code> is displayed as
</p>
<div class="example">
<pre class="example">ans =
+.-
-.+
</pre></div>
</dd>
<dt><code>bank</code></dt>
<dd><p>Print in a fixed format with two digits to the right of the decimal
point.
</p>
</dd>
<dt><code>native-hex</code></dt>
<dd><p>Print the hexadecimal representation of numbers as they are stored in
memory. For example, on a workstation which stores 8 byte real values
in IEEE format with the least significant byte first, the value of
<code>pi</code> when printed in <code>native-hex</code> format is
<code>400921fb54442d18</code>.
</p>
</dd>
<dt><code>hex</code></dt>
<dd><p>The same as <code>native-hex</code>, but always print the most significant
byte first.
</p>
</dd>
<dt><code>native-bit</code></dt>
<dd><p>Print the bit representation of numbers as stored in memory.
For example, the value of <code>pi</code> is
</p>
<div class="example">
<pre class="example">01000000000010010010000111111011
01010100010001000010110100011000
</pre></div>
<p>(shown here in two 32 bit sections for typesetting purposes) when
printed in native-bit format on a workstation which stores 8 byte real
values in IEEE format with the least significant byte first.
</p>
</dd>
<dt><code>bit</code></dt>
<dd><p>The same as <code>native-bit</code>, but always print the most significant
bits first.
</p>
</dd>
<dt><code>rat</code></dt>
<dd><p>Print a rational approximation, i.e., values are approximated
as the ratio of small integers.
For example, with the ‘<samp>rat</samp>’ format,
<code>pi</code> is displayed as <code>355/113</code>.
</p></dd>
</dl>
<p>The following two options affect the display of all matrices.
</p>
<dl compact="compact">
<dt><code>compact</code></dt>
<dd><p>Remove blank lines around column number labels and between
matrices producing more compact output with more data per page.
</p>
</dd>
<dt><code>loose</code></dt>
<dd><p>Insert blank lines above and below column number labels and between matrices
to produce a more readable output with less data per page. (default).
</p></dd>
</dl>
<p><strong>See also:</strong> <a href="Matrices.html#XREFfixed_005fpoint_005fformat">fixed_point_format</a>, <a href="Matrices.html#XREFoutput_005fmax_005ffield_005fwidth">output_max_field_width</a>, <a href="Matrices.html#XREFoutput_005fprecision">output_precision</a>, <a href="Matrices.html#XREFsplit_005flong_005frows">split_long_rows</a>, <a href="Empty-Matrices.html#XREFprint_005fempty_005fdimensions">print_empty_dimensions</a>, <a href="Rational-Approximations.html#XREFrats">rats</a>.
</p></dd></dl>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="Paging-Screen-Output.html#Paging-Screen-Output" accesskey="1">Paging Screen Output</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<div class="header">
<p>
Next: <a href="Terminal-Input.html#Terminal-Input" accesskey="n" rel="next">Terminal Input</a>, Up: <a href="Basic-Input-and-Output.html#Basic-Input-and-Output" accesskey="u" rel="up">Basic Input and Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|