This file is indexed.

/usr/share/doc/octave-htmldoc/interpreter/Ranges.html is in octave-htmldoc 3.8.2-4.

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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: Ranges</title>

<meta name="description" content="GNU Octave: Ranges">
<meta name="keywords" content="GNU Octave: Ranges">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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="Numeric-Data-Types.html#Numeric-Data-Types" rel="up" title="Numeric Data Types">
<link href="Single-Precision-Data-Types.html#Single-Precision-Data-Types" rel="next" title="Single Precision Data Types">
<link href="Empty-Matrices.html#Empty-Matrices" rel="prev" title="Empty Matrices">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
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.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Ranges"></a>
<div class="header">
<p>
Next: <a href="Single-Precision-Data-Types.html#Single-Precision-Data-Types" accesskey="n" rel="next">Single Precision Data Types</a>, Previous: <a href="Matrices.html#Matrices" accesskey="p" rel="prev">Matrices</a>, Up: <a href="Numeric-Data-Types.html#Numeric-Data-Types" accesskey="u" rel="up">Numeric Data Types</a> &nbsp; [<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="Ranges-1"></a>
<h3 class="section">4.2 Ranges</h3>
<a name="index-range-expressions"></a>
<a name="index-expression_002c-range"></a>

<a name="index-_003a"></a>

<p>A <em>range</em> is a convenient way to write a row vector with evenly
spaced elements.  A range expression is defined by the value of the first
element in the range, an optional value for the increment between
elements, and a maximum value which the elements of the range will not
exceed.  The base, increment, and limit are separated by colons (the
&lsquo;<samp>:</samp>&rsquo; character) and may contain any arithmetic expressions and
function calls.  If the increment is omitted, it is assumed to be 1.
For example, the range
</p>
<div class="example">
<pre class="example">1 : 5
</pre></div>

<p>defines the set of values &lsquo;<samp>[ 1, 2, 3, 4, 5 ]</samp>&rsquo;, and the range
</p>
<div class="example">
<pre class="example">1 : 3 : 5
</pre></div>

<p>defines the set of values &lsquo;<samp>[ 1, 4 ]</samp>&rsquo;.
</p>
<p>Although a range constant specifies a row vector, Octave does <em>not</em>
convert range constants to vectors unless it is necessary to do so.
This allows you to write a constant like &lsquo;<samp>1 : 10000</samp>&rsquo; without using
80,000 bytes of storage on a typical 32-bit workstation.
</p>
<p>A common example of when it does become necessary to convert ranges into
vectors occurs when they appear within a vector (i.e., inside square
brackets).  For instance, whereas
</p>
<div class="example">
<pre class="example">x = 0 : 0.1 : 1;
</pre></div>

<p>defines <var>x</var> to be a variable of type <code>range</code> and occupies 24
bytes of memory, the expression
</p>
<div class="example">
<pre class="example">y = [ 0 : 0.1 : 1];
</pre></div>

<p>defines <var>y</var> to be of type <code>matrix</code> and occupies 88 bytes of
memory.
</p>
<p>Note that the upper (or lower, if the increment is negative) bound on
the range is not always included in the set of values, and that ranges
defined by floating point values can produce surprising results because
Octave uses floating point arithmetic to compute the values in the
range.  If it is important to include the endpoints of a range and the
number of elements is known, you should use the <code>linspace</code> function
instead (see <a href="Special-Utility-Matrices.html#Special-Utility-Matrices">Special Utility Matrices</a>).
</p>
<p>When adding a scalar to a range, subtracting a scalar from it (or subtracting a
range from a scalar) and multiplying by scalar, Octave will attempt to avoid
unpacking the range and keep the result as a range, too, if it can determine
that it is safe to do so.  For instance, doing
</p>
<div class="example">
<pre class="example">a = 2*(1:1e7) - 1;
</pre></div>

<p>will produce the same result as &lsquo;<samp>1:2:2e7-1</samp>&rsquo;, but without ever forming a
vector with ten million elements.
</p>
<p>Using zero as an increment in the colon notation, as &lsquo;<samp>1:0:1</samp>&rsquo; is not
allowed, because a division by zero would occur in determining the number of
range elements.  However, ranges with zero increment (i.e., all elements equal)
are useful, especially in indexing, and Octave allows them to be constructed
using the built-in function <em>ones</em>.  Note that because a range must be a row
vector, &lsquo;<samp>ones (1, 10)</samp>&rsquo; produces a range, while &lsquo;<samp>ones (10, 1)</samp>&rsquo; does
not.
</p>
<p>When Octave parses a range expression, it examines the elements of the
expression to determine whether they are all constants.  If they are, it
replaces the range expression with a single range constant.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Single-Precision-Data-Types.html#Single-Precision-Data-Types" accesskey="n" rel="next">Single Precision Data Types</a>, Previous: <a href="Matrices.html#Matrices" accesskey="p" rel="prev">Matrices</a>, Up: <a href="Numeric-Data-Types.html#Numeric-Data-Types" accesskey="u" rel="up">Numeric Data Types</a> &nbsp; [<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>