Mercurial > hg > octave-lyh
annotate doc/interpreter/arith.txi @ 8783:aee6f5c6665e
include DOCSTRING entries for cummin and cummax
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 17 Feb 2009 21:36:34 +0100 |
parents | 6f2d95255911 |
children | 8463d1a2e544 |
rev | line source |
---|---|
7018 | 1 @c Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2007 John W. Eaton |
2 @c | |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
3294 | 18 |
4167 | 19 @node Arithmetic |
3294 | 20 @chapter Arithmetic |
21 | |
22 Unless otherwise noted, all of the functions described in this chapter | |
23 will work for real and complex scalar or matrix arguments. | |
24 | |
25 @menu | |
26 * Utility Functions:: | |
27 * Complex Arithmetic:: | |
28 * Trigonometry:: | |
29 * Sums and Products:: | |
30 * Special Functions:: | |
3803 | 31 * Coordinate Transformations:: |
3294 | 32 * Mathematical Constants:: |
33 @end menu | |
34 | |
4169 | 35 @node Utility Functions |
3294 | 36 @section Utility Functions |
37 | |
38 The following functions are available for working with complex numbers. | |
39 Each expects a single argument. They are called @dfn{mapping functions} | |
40 because when given a matrix argument, they apply the given function to | |
41 each element of the matrix. | |
42 | |
3321 | 43 @DOCSTRING(ceil) |
3294 | 44 |
6550 | 45 @DOCSTRING(cplxpair) |
46 | |
6788 | 47 @DOCSTRING(del2) |
48 | |
3321 | 49 @DOCSTRING(exp) |
3294 | 50 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
51 @DOCSTRING(expm1) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
52 |
6550 | 53 @DOCSTRING(factor) |
54 | |
55 @DOCSTRING(factorial) | |
56 | |
3321 | 57 @DOCSTRING(fix) |
3294 | 58 |
3321 | 59 @DOCSTRING(floor) |
3294 | 60 |
6550 | 61 @DOCSTRING(fmod) |
62 | |
3321 | 63 @DOCSTRING(gcd) |
3294 | 64 |
6551 | 65 @DOCSTRING(gradient) |
66 | |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
67 @DOCSTRING(hypot) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
68 |
3321 | 69 @DOCSTRING(lcm) |
3294 | 70 |
3321 | 71 @DOCSTRING(log) |
3294 | 72 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
73 @DOCSTRING(log1p) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
74 |
3321 | 75 @DOCSTRING(log10) |
3294 | 76 |
3321 | 77 @DOCSTRING(log2) |
3294 | 78 |
3321 | 79 @DOCSTRING(max) |
3294 | 80 |
3321 | 81 @DOCSTRING(min) |
82 | |
8783
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
83 @DOCSTRING(cummax) |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
84 |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
85 @DOCSTRING(cummin) |
aee6f5c6665e
include DOCSTRING entries for cummin and cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
8286
diff
changeset
|
86 |
3982 | 87 @DOCSTRING(mod) |
88 | |
3321 | 89 @DOCSTRING(nextpow2) |
3294 | 90 |
6550 | 91 @DOCSTRING(nthroot) |
92 | |
3321 | 93 @DOCSTRING(pow2) |
3294 | 94 |
6550 | 95 @DOCSTRING(primes) |
96 | |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
97 @DOCSTRING(reallog) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
98 |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
99 @DOCSTRING(realpow) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
100 |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
101 @DOCSTRING(realsqrt) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
102 |
3321 | 103 @DOCSTRING(rem) |
3294 | 104 |
3321 | 105 @DOCSTRING(round) |
3294 | 106 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
107 @DOCSTRING(roundb) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7018
diff
changeset
|
108 |
3321 | 109 @DOCSTRING(sign) |
3294 | 110 |
3321 | 111 @DOCSTRING(sqrt) |
3294 | 112 |
4169 | 113 @node Complex Arithmetic |
3294 | 114 @section Complex Arithmetic |
115 | |
116 The following functions are available for working with complex | |
117 numbers. Each expects a single argument. Given a matrix they work on | |
118 an element by element basis. In the descriptions of the following | |
119 functions, | |
120 @iftex | |
121 @tex | |
122 $z$ is the complex number $x + iy$, where $i$ is defined as | |
123 $\sqrt{-1}$. | |
124 @end tex | |
125 @end iftex | |
126 @ifinfo | |
127 @var{z} is the complex number @var{x} + @var{i}@var{y}, where @var{i} is | |
128 defined as @code{sqrt (-1)}. | |
129 @end ifinfo | |
130 | |
3321 | 131 @DOCSTRING(abs) |
3294 | 132 |
3321 | 133 @DOCSTRING(arg) |
3294 | 134 |
3321 | 135 @DOCSTRING(conj) |
3294 | 136 |
3321 | 137 @DOCSTRING(imag) |
3294 | 138 |
3321 | 139 @DOCSTRING(real) |
3294 | 140 |
4169 | 141 @node Trigonometry |
3294 | 142 @section Trigonometry |
143 | |
144 Octave provides the following trigonometric functions. Angles are | |
6939 | 145 specified in radians. To convert from degrees to radians multiply by |
3294 | 146 @iftex |
147 @tex | |
148 $\pi/180$ | |
149 @end tex | |
150 @end iftex | |
151 @ifinfo | |
152 @code{pi/180} | |
153 @end ifinfo | |
154 (e.g. @code{sin (30 * pi/180)} returns the sine of 30 degrees). | |
155 | |
3321 | 156 @DOCSTRING(sin) |
157 @DOCSTRING(cos) | |
158 @DOCSTRING(tan) | |
159 @DOCSTRING(sec) | |
160 @DOCSTRING(csc) | |
161 @DOCSTRING(cot) | |
3294 | 162 |
3321 | 163 @DOCSTRING(asin) |
164 @DOCSTRING(acos) | |
165 @DOCSTRING(atan) | |
166 @DOCSTRING(asec) | |
167 @DOCSTRING(acsc) | |
168 @DOCSTRING(acot) | |
3294 | 169 |
3321 | 170 @DOCSTRING(sinh) |
171 @DOCSTRING(cosh) | |
172 @DOCSTRING(tanh) | |
173 @DOCSTRING(sech) | |
3428 | 174 @DOCSTRING(csch) |
3321 | 175 @DOCSTRING(coth) |
3294 | 176 |
3321 | 177 @DOCSTRING(asinh) |
178 @DOCSTRING(acosh) | |
179 @DOCSTRING(atanh) | |
180 @DOCSTRING(asech) | |
181 @DOCSTRING(acsch) | |
182 @DOCSTRING(acoth) | |
3294 | 183 |
7001 | 184 Each of these functions expects a single argument. For matrix arguments, |
3294 | 185 they work on an element by element basis. For example, |
186 | |
187 @example | |
188 @group | |
189 sin ([1, 2; 3, 4]) | |
190 @result{} 0.84147 0.90930 | |
191 0.14112 -0.75680 | |
192 @end group | |
193 @end example | |
194 | |
3321 | 195 @DOCSTRING(atan2) |
196 | |
6502 | 197 In addition to the trigonometric functions that work with radians, |
198 Octave also provides the following functions which work with degrees. | |
199 | |
200 @DOCSTRING(sind) | |
201 @DOCSTRING(cosd) | |
202 @DOCSTRING(tand) | |
203 @DOCSTRING(secd) | |
204 @DOCSTRING(cscd) | |
205 @DOCSTRING(cotd) | |
206 | |
207 @DOCSTRING(asind) | |
208 @DOCSTRING(acosd) | |
209 @DOCSTRING(atand) | |
210 @DOCSTRING(asecd) | |
211 @DOCSTRING(acscd) | |
212 @DOCSTRING(acotd) | |
3294 | 213 |
4169 | 214 @node Sums and Products |
3294 | 215 @section Sums and Products |
216 | |
3321 | 217 @DOCSTRING(sum) |
3294 | 218 |
3321 | 219 @DOCSTRING(prod) |
3294 | 220 |
3321 | 221 @DOCSTRING(cumsum) |
3294 | 222 |
3321 | 223 @DOCSTRING(cumprod) |
3294 | 224 |
3321 | 225 @DOCSTRING(sumsq) |
3294 | 226 |
6770 | 227 @DOCSTRING(accumarray) |
228 | |
4169 | 229 @node Special Functions |
3294 | 230 @section Special Functions |
231 | |
3459 | 232 @DOCSTRING(besselj) |
233 | |
234 @DOCSTRING(airy) | |
3294 | 235 |
3321 | 236 @DOCSTRING(beta) |
3294 | 237 |
3444 | 238 @DOCSTRING(betainc) |
3294 | 239 |
6502 | 240 @DOCSTRING(betaln) |
241 | |
3321 | 242 @DOCSTRING(bincoeff) |
3294 | 243 |
3321 | 244 @DOCSTRING(erf) |
3294 | 245 |
3321 | 246 @DOCSTRING(erfc) |
3294 | 247 |
3321 | 248 @DOCSTRING(erfinv) |
3294 | 249 |
3321 | 250 @DOCSTRING(gamma) |
3294 | 251 |
3444 | 252 @DOCSTRING(gammainc) |
3294 | 253 |
6502 | 254 @DOCSTRING(legendre) |
255 | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7984
diff
changeset
|
256 @anchor{doc-gammaln} |
3321 | 257 @DOCSTRING(lgamma) |
258 | |
259 @DOCSTRING(cross) | |
3294 | 260 |
3321 | 261 @DOCSTRING(commutation_matrix) |
3294 | 262 |
3321 | 263 @DOCSTRING(duplication_matrix) |
3294 | 264 |
4169 | 265 @node Coordinate Transformations |
3803 | 266 @section Coordinate Transformations |
267 | |
268 @DOCSTRING(cart2pol) | |
269 | |
270 @DOCSTRING(pol2cart) | |
271 | |
272 @DOCSTRING(cart2sph) | |
273 | |
274 @DOCSTRING(sph2cart) | |
275 | |
4169 | 276 @node Mathematical Constants |
3294 | 277 @section Mathematical Constants |
278 | |
3321 | 279 @DOCSTRING(I) |
280 | |
281 @DOCSTRING(Inf) | |
3294 | 282 |
3321 | 283 @DOCSTRING(NaN) |
3294 | 284 |
3321 | 285 @DOCSTRING(pi) |
3294 | 286 |
3321 | 287 @DOCSTRING(e) |
288 | |
289 @DOCSTRING(eps) | |
3294 | 290 |
3321 | 291 @DOCSTRING(realmax) |
3294 | 292 |
3321 | 293 @DOCSTRING(realmin) |