Mercurial > octave-nkf
annotate doc/refcard/refcard.tex @ 19630:0e1f5a750d00
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Jan 2015 10:24:46 -0500 |
parents | 9ac2357f19bc 446c46af4b42 |
children | 4197fc428c7d |
rev | line source |
---|---|
2333 | 1 % refcard.tex |
2 % | |
3 % This file is TeX source for a reference card describing Octave. | |
4 % | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
14856
diff
changeset
|
5 % Copyright (C) 1996-2013 John W. Eaton |
2333 | 6 % |
7016 | 7 % This file is part of Octave. |
8 % | |
9 % Octave is free software; you can redistribute it and/or modify it | |
10 % under the terms of the GNU General Public License as published by the | |
11 % Free Software Foundation; either version 3 of the License, or (at your | |
12 % option) any later version. | |
2333 | 13 % |
7016 | 14 % Octave is distributed in the hope that it will be useful, but WITHOUT |
15 % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 % for more details. | |
2333 | 18 % |
7016 | 19 % You should have received a copy of the GNU General Public License |
20 % along with Octave; see the file COPYING. If not, see | |
21 % <http://www.gnu.org/licenses/>. | |
2333 | 22 % |
7018 | 23 % Heavily modified by jwe from the source for the gdb reference card, |
24 % which was orignally written by Roland Pesch <pesch@cygnus.com>. | |
25 % | |
26 % Copyright (C) 1991, 1992 Free Software Foundation, Inc. | |
27 % Permission is granted to make and distribute verbatim copies of | |
28 % this reference provided the copyright notices and permission notices | |
29 % are preserved on all copies. | |
30 % | |
31 % TeX markup is a programming language; accordingly this file is source | |
32 % for a program to generate a reference. | |
33 % | |
2333 | 34 % You only have to set the total width and height of the paper, the |
35 % horizontal and vertical margin space measured from *paper edge* | |
36 % and the interline and interspec spacing. | |
37 % In order to support a new papersize, you have to fiddle with the | |
38 % latter four dimensions. Just try out a few values. | |
39 % All other values will be computed at process time so it should be | |
40 % quite easy to support different paper sizes - only four values to | |
41 % guess :-) | |
42 % | |
43 % To find the configuration places, just search for the string | |
44 % "User configuration". | |
45 % | |
46 % -- Andreas Vogel (av@ssw.de) | |
47 % | |
48 % NOTE ON INTENTIONAL OMISSIONS: This reference card includes many | |
49 % Octave commands, but due to space constraints there are some things | |
50 % I chose to omit. In general, not all synonyms for commands are | |
51 % covered, nor all variations of a command. | |
52 | |
7040 | 53 \def\octaveversion{3.0.0} |
54 \def\refcardedition{2.0} | |
2333 | 55 |
56 % ------------------ | |
57 % multicolumn format | |
58 % ------------------ | |
59 | |
60 % Declarations (these must come first) | |
61 | |
62 \newdimen\totalwidth | |
63 \newdimen\totalheight | |
64 \newdimen\hmargin | |
65 \newdimen\vmargin | |
66 \newdimen\secskip | |
67 \newdimen\lskip | |
68 \newdimen\barwidth | |
69 \newdimen\barheight | |
70 \newdimen\intersecwidth | |
71 | |
72 \newcount\columnsperpage | |
73 | |
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
75 % % | |
76 % CONFIGURATION % | |
77 % % | |
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
79 | |
80 % There are currently 8 total columns, so some of these options will | |
81 % not create a single page reference card. | |
82 | |
83 % Choose a paper size. Default is US letter size. | |
84 | |
85 \def\refcardafoursize{a4} % 3 columns, A4 paper (1 in = 254 mm) | |
86 \def\refcardlegalsize{legal} % 4 columns, US legal paper (8.5 x 14in) | |
4893 | 87 \def\refcardlettersize{letter} % 3 columns, US letter paper (8.5 x 11in) |
2333 | 88 |
89 \ifx\refcardsize\refcardafoursize | |
90 \columnsperpage=3 % total number of columns to typeset | |
91 \totalwidth=297mm % total width of paper | |
92 \totalheight=210mm % total height of paper | |
93 \hmargin=9mm % horizontal margin width | |
94 \vmargin=7mm % vertical margin width | |
95 \secskip=3mm % space between refcard secs | |
96 \lskip=0.4mm % extra skip between \sec entries | |
97 \else | |
98 \ifx\refcardsize\refcardlegalsize | |
99 \columnsperpage=4 % total number of columns to typeset | |
100 \totalwidth=14in % total width of paper | |
101 \totalheight=8.5in % total height of paper | |
102 \hmargin=0.20in % horizontal margin width | |
103 \vmargin=0.25in % vertical margin width | |
104 \secskip=0.75pc % space between refcard secs | |
105 \lskip=2pt % extra skip between \sec entries | |
106 \else | |
107 \columnsperpage=3 % total number of columns to typeset | |
108 \totalwidth=11in % total width of paper | |
109 \totalheight=8.5in % total height of paper | |
110 \hmargin=0.25in % horizontal margin width | |
111 \vmargin=0.25in % vertical margin width | |
112 \secskip=0.75pc % space between refcard secs | |
113 \lskip=2pt % extra skip between \sec entries | |
114 \fi | |
115 \fi | |
116 | |
4489 | 117 \ifx\pdfoutput\undefined |
118 \else | |
119 \pdfpageheight=\totalheight | |
4866 | 120 \pdfpagewidth=\totalwidth |
4489 | 121 \fi |
122 | |
2333 | 123 % Change according to personal taste, not papersize dependent. |
124 | |
125 \barwidth=.1pt % width of the cropmark bar | |
126 \barheight=2pt % height of the cropmark bar | |
127 \intersecwidth=0.5em % width between \itmwid and \dfnwid | |
128 | |
129 % Uncomment only one of the following definitions for folding guides. | |
130 | |
131 % No printed folding guide: | |
132 | |
133 %\def\vdecor{\hskip\hmargin plus1fil | |
134 % \hskip\barwidth plus1fil | |
135 % \hskip\hmargin plus1fil} | |
136 | |
137 % Solid line folding guide: | |
138 | |
139 %\def\vdecor{\hskip\hmargin plus1fil% | |
140 % \vrule width \barwidth% | |
141 % \hskip\hmargin plus1fil} | |
142 | |
143 % For small marks near top and bottom as folding guide: | |
144 | |
145 \def\vdecor{\hskip\hmargin plus1fil% | |
146 \vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}% | |
147 \vfill | |
148 \hbox to \barwidth{\vrule height\barheight width\barwidth}}% | |
149 \hskip\hmargin plus1fil} | |
150 | |
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
152 % % | |
153 % END CONFIGURATION % | |
154 % % | |
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
156 | |
157 % values to be computed based on above definitions. | |
158 % nothing to configure | |
159 | |
160 \newdimen\fullhsize % width of area without margins | |
161 \newdimen\itmwid % width of item column | |
162 \newdimen\dfnwid % width of definition column | |
163 \newdimen\idnwid % width of indented text | |
164 \newdimen\temp % only for temporary use | |
165 | |
166 % an alternate section format, used in some cases to make text fit better. | |
167 | |
168 \newdimen\altitmwid % width of item column in altsec | |
169 \newdimen\altdfnwid % width of definition column in altsec | |
170 | |
171 % Subtract hmargin for left and right sides of paper from full width. | |
172 % | |
173 % fullhsize = totalwidth - (2 * hmargin) | |
174 | |
175 \fullhsize=\totalwidth | |
176 \temp=\hmargin | |
177 \multiply \temp by 2 | |
178 \advance \fullhsize by -\temp | |
179 | |
180 % intercolumn space is composed of hmargin barwidth hmargin so that we | |
181 % get the same amount of space on either side of the (optional) rule | |
182 % between columns. For N columns, we need to subtract this amount of | |
183 % space N-1 times. Divide by the number of columns to get the final | |
184 % value of \hsize that we use to typeset columns. | |
185 | |
186 % hsize = (fullhsize - (ncols-1)*barwidth - 2*(ncols-1)*hmargin) / ncols | |
187 | |
188 \newcount\tmpcnt | |
189 \tmpcnt\columnsperpage | |
190 \advance \tmpcnt by -1 | |
191 | |
192 \hsize=\fullhsize | |
193 | |
194 \temp=\barwidth | |
195 \multiply \temp by \tmpcnt | |
196 \advance \hsize by -\temp | |
197 | |
198 \multiply \tmpcnt by 2 | |
199 | |
200 \temp=\hmargin | |
201 \multiply \temp by \tmpcnt | |
202 \advance \hsize by -\temp | |
203 | |
204 \divide \hsize by \columnsperpage | |
205 | |
206 % Vertical size is easy -- same amount of space above and below. | |
207 % | |
208 % vsize = totalheight - (2 * vmargin) | |
209 | |
210 \vsize=\totalheight | |
211 \temp=\vmargin | |
212 \multiply \temp by 2 | |
213 \advance \vsize by -\temp | |
214 | |
215 % adjust the offsets so the margins are measured *from paper edge* | |
216 | |
217 \hoffset=-1in \advance \hoffset by \hmargin | |
218 \voffset=-1in \advance \voffset by \vmargin | |
219 | |
220 % Width of items in a section. | |
221 | |
222 % itmwid = (hsize - intersecwidth) * 1/3 | |
223 % dfnwid = (hsize - intersecwidth) * 2/3 | |
224 | |
225 % width of the item | |
226 | |
227 \temp=\hsize | |
228 \advance \temp by -\intersecwidth | |
229 \divide \temp by 3 | |
230 \itmwid=\temp | |
231 | |
232 % width of the corresponding definition | |
233 | |
234 \dfnwid=\hsize | |
235 \advance \dfnwid by -\itmwid | |
236 | |
237 % indentation for sub items, etc. | |
238 | |
239 \temp=\hsize \advance\temp by -1em | |
240 \idnwid=\temp | |
241 | |
242 % Width of items in an alt section. | |
243 | |
244 \altitmwid=\itmwid \advance \altitmwid by 0.35in | |
245 \altdfnwid=\dfnwid \advance \altdfnwid by -0.35in | |
246 | |
247 % Output macros. | |
248 % | |
249 % Strategy: | |
250 % | |
251 % * set each column in a box | |
252 % * append new columns in a global `holding' box, inserting | |
253 % intercolumn decorations as necessary. | |
254 % * when we fill a page, dump the saved box and the latest column, | |
255 % separated by the intercolumn decoration. | |
256 | |
257 \newbox\holdbox | |
258 \newcount\colno | |
259 \colno=0 | |
260 | |
261 \output={\relax | |
262 \global\advance\colno by 1 | |
263 \ifnum\colno=1 | |
264 \global\setbox\holdbox=\columnbox | |
265 \else | |
266 \ifnum\colno=\columnsperpage | |
267 \shipout\hbox to \fullhsize{\box\holdbox\vdecor\columnbox} | |
268 \advancepageno | |
269 \global\colno=0 | |
270 \else | |
271 \global\setbox\holdbox=\vbox{\hbox{\box\holdbox\vdecor\columnbox}} | |
272 \fi | |
273 \fi} | |
274 | |
275 \def\columnbox{\leftline{\pagebody}} | |
276 | |
277 \def\bye{\par\vfill | |
278 \supereject | |
279 \if R\lcr \null\vfill\eject \fi | |
280 \end} | |
281 | |
282 % ----- | |
283 % Fonts | |
284 % ----- | |
285 | |
286 \font\bbf=cmbx10 | |
287 \font\vbbf=cmbx12 | |
288 \font\smrm=cmr6 | |
289 \font\brm=cmr10 | |
290 \font\rm=cmr7 | |
291 \font\it=cmti7 | |
292 \font\tt=cmtt8 | |
293 | |
294 % We can afford to allow some slop | |
295 | |
296 \hfuzz=1pt | |
297 \vfuzz=1pt | |
298 \hyphenpenalty=5000 | |
299 \tolerance=2000 | |
300 \raggedright | |
301 \raggedbottom | |
302 \normalbaselineskip=9pt | |
303 \baselineskip=9pt | |
304 | |
305 \parindent=0pt | |
306 \parskip=0pt | |
307 \footline={\vbox to0pt{\hss}} | |
308 | |
309 \def\ctl#1{{\tt C-#1}} | |
310 \def\opt#1{{\brm[{\rm #1}]}} | |
311 \def\xtra#1{\noalign{\smallskip{\tt#1}}} | |
312 | |
313 % A normal section | |
314 | |
315 \long\def\sec#1;#2\endsec{\vskip \secskip | |
316 \halign{% | |
317 % | |
318 % column 1 (of halign): | |
319 % | |
320 \vtop{\hsize=\itmwid\tt ##\par\vskip \lskip }\hfil | |
321 % | |
322 % column 2 (of halign): | |
323 % | |
324 &\vtop{% | |
325 \hsize=\dfnwid | |
326 \hangafter=1 | |
327 \hangindent=\intersecwidth | |
328 \rm ##\par\vskip \lskip}\cr | |
329 % | |
330 % Tail of \long\def fills in halign body with \sec args: | |
331 % | |
332 \noalign{{\bbf #1}% | |
333 \vskip \lskip} | |
334 #2}} | |
335 | |
336 \long\def\widesec#1;#2\endsec{\vskip \secskip | |
337 \halign{% | |
338 % | |
339 % column 1 (of halign): | |
340 % | |
341 \vbox{\tt | |
342 ##\par\vskip \lskip }\cr | |
343 % | |
344 % Tail of \long\def fills in halign body with \sec args: | |
345 % | |
346 \noalign{{\bbf #1}\vskip 3\lskip} | |
347 #2}} | |
348 | |
349 % an alternate section format, used in some cases to make text fit better. | |
350 | |
351 \long\def\altsec#1;#2\endsec{\vskip \secskip | |
352 \halign{% | |
353 % | |
354 % column 1 (of halign): | |
355 % | |
356 \vtop{\hsize=\altitmwid\tt | |
357 ##\par\vskip \lskip}\hfil | |
358 % | |
359 % column 2 (of halign): | |
360 % | |
361 &\vtop{% | |
362 \hsize=\altdfnwid | |
363 \hangafter=1 | |
364 \hangindent=\intersecwidth | |
365 \rm ##\par\vskip \lskip}\cr | |
366 % | |
367 % Tail of \long\def fills in halign body with \sec args: | |
368 % | |
369 \noalign{{\bbf #1}\vskip \lskip} | |
370 #2}} | |
371 | |
372 % ------------------------------------- | |
373 % The actual text of the reference card | |
374 % ------------------------------------- | |
375 | |
376 {\vbbf Octave Quick Reference}\hfil{\smrm Octave Version \octaveversion}\qquad | |
377 | |
378 \sec Starting Octave; | |
379 octave&start interactive Octave session\cr | |
380 octave {\it file}&run Octave on commands in {\it file}\cr | |
7040 | 381 octave --eval {\it code}&Evaluate {\it code} using Octave\cr |
2333 | 382 octave --help&describe command line options\cr |
383 \endsec | |
384 | |
385 \sec Stopping Octave; | |
386 quit {\rm or} exit&exit Octave\cr | |
387 INTERRUPT&({\it e.g.} \ctl{c}) terminate current command and return to | |
388 top-level prompt\cr | |
389 \endsec | |
390 | |
391 \sec Getting Help; | |
392 help&list all commands and built-in variables\cr | |
393 help {\it command}&briefly describe {\it command}\cr | |
7040 | 394 doc&use Info to browse Octave manual\cr |
395 doc {\it command}&search for {\it command} in Octave manual\cr | |
396 lookfor {\it str}&search for {\it command} based on {\it str}\cr | |
2333 | 397 \endsec |
398 | |
399 \sec Motion in Info; | |
400 SPC {\rm or} C-v&scroll forward one screenful\cr | |
401 DEL {\rm or} M-v&scroll backward one screenful\cr | |
402 C-l&redraw the display\cr | |
403 \endsec | |
404 | |
405 \sec Node Selection in Info; | |
406 n&select the next node\cr | |
407 p&select the previous node\cr | |
408 u&select the `up' node\cr | |
409 t&select the `top' node\cr | |
410 d&select the directory node\cr | |
411 <&select the first node in the current file\cr | |
412 >&select the last node in the current file\cr | |
413 % ]&move forward through the node structure\cr | |
414 % [&move backward through the nodes\cr | |
415 g&reads the name of a node and selects it\cr | |
416 C-x k&kills the current node\cr | |
417 \endsec | |
418 | |
419 \sec Searching in Info; | |
420 s&search for a string\cr | |
421 C-s&search forward incrementally\cr | |
422 C-r&search backward incrementally\cr | |
423 i&search index \& go to corresponding node\cr | |
424 ,&go to next match from last `i' command\cr | |
425 \endsec | |
426 | |
427 \sec Command-Line Cursor Motion; | |
428 C-b&move back one character\cr | |
429 C-f&move forward one character\cr | |
6653 | 430 C-a&move to the start of the line\cr |
2333 | 431 C-e&move to the end of the line\cr |
432 M-f&move forward a word\cr | |
433 M-b&move backward a word\cr | |
434 C-l&clear screen, reprinting current line at top\cr | |
435 \endsec | |
436 | |
437 \sec Inserting or Changing Text; | |
438 M-TAB&insert a tab character\cr | |
439 DEL&delete character to the left of the cursor\cr | |
440 C-d&delete character under the cursor\cr | |
441 C-v&add the next character verbatim\cr | |
442 C-t&transpose characters at the point\cr | |
443 M-t&transpose words at the point\cr | |
444 % M-u&uppercase the current word\cr | |
445 % M-l&lowercase the current word\cr | |
446 % M-c&capitalize the current word\cr | |
447 \endsec | |
448 | |
449 \vfill | |
450 \line{\smrm \opt{ } surround optional arguments | |
451 \hfill ... show one or more arguments} | |
452 \vskip0.25\baselineskip | |
453 \eject | |
454 | |
455 \sec Killing and Yanking; | |
456 C-k&kill to the end of the line\cr | |
457 C-y&yank the most recently killed text\cr | |
458 M-d&kill to the end of the current word\cr | |
459 M-DEL&kill the word behind the cursor\cr | |
460 M-y&rotate the kill ring and yank the new top\cr | |
461 \endsec | |
462 | |
463 \sec Command Completion and History; | |
464 TAB&complete a command or variable name\cr | |
465 M-?&list possible completions\cr | |
466 | |
467 RET&enter the current line \cr | |
468 C-p&move `up' through the history list\cr | |
469 C-n&move `down' through the history list\cr | |
470 M-<&move to the first line in the history\cr | |
471 M->&move to the last line in the history\cr | |
472 C-r&search backward in the history list\cr | |
473 C-s&search forward in the history list\cr | |
474 | |
475 history \opt{{-q}} \opt{{\it N\/}}&list {\it N\/} previous history lines, | |
476 omitting history numbers if {\tt -q}\cr | |
477 history -w \opt{{\it file}}&write history to {\it file\/} ({\tt | |
478 \char'0176/.octave\_hist} if no {\it file\/} argument)\cr | |
479 history -r \opt{{\it file}}&read history from {\it file\/} ({\tt | |
480 \char'0176/.octave\_hist} if no {\it file\/} argument)\cr | |
481 | |
482 edit\_history {\it lines}&edit and then run previous | |
483 commands from the history list\cr | |
484 run\_history {\it lines}&run previous commands from the | |
485 history list\cr | |
486 \quad\opt{{\it beg\/}} \opt{{\it end\/}}&Specify the first and last | |
487 history commands to edit or run.\cr | |
488 \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
489 If {\it beg}\/ is greater than {\it end}, | |
490 reverse the list of commands before editing. If {\it end\/} is | |
491 omitted, select commands from {\it beg\/} to the end of the history | |
492 list. If both arguments are omitted, edit the previous item in the | |
493 history list.}\span\cr | |
494 \endsec | |
495 | |
496 \sec Shell Commands; | |
497 cd {\it dir}&change working directory to {\it dir}\cr | |
498 pwd&print working directory\cr | |
499 ls \opt{{\it options}}&print directory listing\cr | |
500 getenv ({\it string})&return value of named environment variable\cr | |
501 system ({\it cmd})&execute arbitrary shell command string\cr | |
502 \endsec | |
503 | |
504 \sec Matrices; | |
505 \omit\vbox{\rm\vskip0.25ex | |
506 Square brackets delimit literal matrices. Commas separate elements | |
507 on the same row. Semicolons separate rows. Commas may be replaced | |
508 by spaces, and semicolons may be replaced by one or more newlines. | |
7040 | 509 Elements of a matrix may be arbitrary expressions, assuming |
2333 | 510 all the dimensions agree.\vskip0.75ex}\span\cr |
511 [ {\it x}, {\it y}, ... ]&enter a row vector\cr | |
512 [ {\it x}; {\it y}; ... ]&enter a column vector\cr | |
513 [ {\it w}, {\it x}; {\it y}, {\it z} ]&enter a 2$\times$2 matrix\cr | |
514 \endsec | |
515 | |
7040 | 516 \sec Multi-dimensional Arrays; |
517 \omit\vbox{\rm\vskip0.25ex | |
518 Multi-dimensional arrays may be created with the {\it cat} or | |
519 {\it reshape} commands from two-dimensional sub-matrices. | |
520 \vskip0.75ex}\span\cr | |
521 squeeze ({\it arr})&remove singleton dimensions of the array.\cr | |
522 ndims ({\it arr})&number of dimensions in the array.\cr | |
523 permute ({\it arr}, {\it p})&permute the dimensions of an array.\cr | |
524 ipermute ({\it arr}, {\it p})&array inverse permutation.\cr | |
525 \endsec | |
526 | |
527 \vfill\eject | |
528 | |
529 \sec ; | |
530 shiftdim ({\it arr}, {\it s})&rotate the array dimensions.\cr | |
531 circshift ({\it arr}, {\it s})&rotate the array elements.\cr | |
532 \endsec | |
533 | |
534 \sec Sparse Matrices; | |
535 sparse (...)&create a sparse matrix.\cr | |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
536 speye ({\it n)}&create sparse identity matrix.\cr |
7040 | 537 sprand ({\it n}, {\it m}, {\it d})&sparse rand matrix of density {\it d}.\cr |
538 spdiags (...)&sparse generalization of {\it diag}.\cr | |
18851
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
539 nnz ({\it s})&No. nonzero elements in sparse matrix.\cr |
7040 | 540 \endsec |
541 | |
2333 | 542 \sec Ranges; |
543 {\it base} : {\it limit}\cr | |
544 {\it base} : {\it incr} : {\it limit}\cr | |
545 \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.75ex | |
546 Specify a range of values beginning with {\it base\/} with no elements | |
547 greater than {\it limit}. If it is omitted, the default value of | |
548 {\it incr\/} is 1. Negative increments are permitted.}\span\cr | |
549 \endsec | |
550 | |
551 \sec Strings and Common Escape Sequences; | |
552 \omit\vbox{\rm\vskip0.5ex | |
553 A {\it string constant\/} consists of a sequence of characters | |
7040 | 554 enclosed in either double-quote or single-quote marks. Strings |
555 in double-quotes allow the use of the escape sequences below. | |
556 \vskip0.75ex}\span\cr | |
2333 | 557 \char'134\char'134&a literal backslash\cr |
558 \char'134 "&a literal double-quote character\cr | |
559 \char'134 '&a literal single-quote character\cr | |
560 \char'134 n&newline, ASCII code 10\cr | |
561 \char'134 t&horizontal tab, ASCII code 9\cr | |
562 \endsec | |
563 | |
564 \sec Index Expressions; | |
565 {\it var} ({\it idx})&select elements of a vector\cr | |
566 {\it var} ({\it idx1}, {\it idx2})&select elements of a matrix\cr | |
567 | |
568 \quad {\it scalar}&select row (column) corresponding to {\it scalar}\cr | |
569 \quad {\it vector}&select rows (columns) corresponding to the elements | |
570 of {\it vector}\cr | |
571 \quad {\it range}&select rows (columns) corresponding to the elements | |
572 of {\it range}\cr | |
573 \quad :&select all rows (columns)\cr | |
574 \endsec | |
575 | |
7040 | 576 \sec Global and Persistent Variables; |
2333 | 577 global {\it var1} ...&Declare variables global.\cr |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
578 global {\it var1} = {\it val}&Declare variable global. Set initial value.\cr |
7040 | 579 persistent {\it var1}&Declare a variable as static to a function.\cr |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
580 persistent {\it var1} = {\it val}&Declare a variable as static to a |
7040 | 581 function and set its initial value.\cr |
582 \omit\hfill\vbox{\rm\vskip0.25ex | |
2333 | 583 Global variables may be accessed inside the body of a function |
584 without having to be passed in the function parameter list provided | |
7040 | 585 they are declared global when used.}\span\cr |
2333 | 586 \endsec |
587 | |
6548 | 588 \sec Selected Built-in Functions; |
2333 | 589 EDITOR&editor to use with {\tt edit\_history}\cr |
590 Inf, NaN&IEEE infinity, NaN\cr | |
7040 | 591 NA&Missing value\cr |
2333 | 592 PAGER&program to use to paginate output\cr |
593 ans&last result not explicitly assigned\cr | |
594 eps&machine precision\cr | |
595 pi&$\pi$\cr | |
7040 | 596 1i&$\sqrt{-1}$\cr |
2333 | 597 realmax&maximum representable value\cr |
598 realmin&minimum representable value\cr | |
599 \endsec | |
600 | |
7040 | 601 \vfill |
602 \centerline{\smrm Copyright 1996, 1997, 2007 John W. Eaton\qquad Permissions on back} | |
603 \eject | |
604 | |
605 \sec Assignment Expressions; | |
606 {\it var} = {\it expr}&assign expression to variable\cr | |
607 {\it var} ({\it idx}) = {\it expr}&assign expression to indexed variable\cr | |
608 {\it var} ({\it idx}) = []&delete the indexed elements.\cr | |
609 {\it var} $\{${\it idx}$\}$ = {\it expr}&assign elements of a cell array.\cr | |
610 \endsec | |
2333 | 611 |
612 \sec Arithmetic and Increment Operators; | |
613 {\it x} + {\it y}&addition\cr | |
614 {\it x} - {\it y}&subtraction\cr | |
615 {\it x} * {\it y}&matrix multiplication\cr | |
616 {\it x} .* {\it y}&element by element multiplication\cr | |
617 {\it x} / {\it y}&right division, conceptually equivalent to | |
618 {\tt (inverse~(y')~*~x')'}\cr | |
619 {\it x} ./ {\it y}&element by element right division\cr | |
620 {\it x} \char'134{} {\it y}&left division, conceptually equivalent to | |
621 {\tt inverse~(x)~*~y}\cr | |
622 {\it x} .\char'134{} {\it y}&element by element left division\cr | |
623 {\it x} \char'136{} {\it y}&power operator\cr | |
624 {\it x} .\char'136{} {\it y}&element by element power operator\cr | |
625 - {\it x}&negation\cr | |
626 + {\it x}&unary plus (a no-op)\cr | |
627 {\it x} '&complex conjugate transpose\cr | |
628 {\it x} .'&transpose\cr | |
7040 | 629 ++ {\it x}\quad{\rm(}-- {\it x}{\rm)}&increment (decrement), |
2333 | 630 return {\it new\/} value\cr |
7040 | 631 {\it x} ++\quad{\rm(}{\it x} --{\rm)}&increment (decrement), |
2333 | 632 return {\it old\/} value\cr |
633 \endsec | |
634 | |
635 \sec Comparison and Boolean Operators; | |
636 \omit \vbox{\rm\vskip0.75ex | |
637 These operators work on an element-by-element basis. Both arguments | |
638 are always evaluated.\vskip0.75ex}\span\cr | |
639 {\it x} < {\it y}&true if {\it x\/} is less than {\it y}\cr | |
640 {\it x} <= {\it y}&true if {\it x\/} is less than or equal to {\it y}\cr | |
3602 | 641 {\it x} == {\it y}&true if {\it x\/} is equal to {\it y}\cr |
2333 | 642 {\it x} >= {\it y}&true if {\it x\/} is greater than or equal to {\it y}\cr |
3602 | 643 {\it x} > {\it y}&true if {\it x\/} is greater than {\it y}\cr |
2333 | 644 {\it x} != {\it y}&true if {\it x\/} is not equal to {\it y}\cr |
645 {\it x} \& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
646 {\it x} | {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr |
3602 | 647 ! {\it bool}&true if {\it bool\/} is false\cr |
2333 | 648 \endsec |
649 | |
650 \sec Short-circuit Boolean Operators; | |
651 \omit \vbox{\rm\vskip0.75ex | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
652 Operators evaluate left-to-right. Operands are only evaluated if |
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
653 necessary, stopping once overall truth value can be determined. |
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
654 Operands are converted to scalars using the {\tt all} |
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
655 function.\vskip0.75ex}\span\cr |
2333 | 656 {\it x} \&\& {\it y}&true if both {\it x\/} and {\it y\/} are true\cr |
657 {\it x} || {\it y}&true if at least one of {\it x\/} or {\it y\/} is true\cr | |
658 \endsec | |
659 | |
660 \sec Operator Precedence; | |
661 \omit \vbox{\rm\vskip0.5ex | |
7040 | 662 Table of Octave operators, in order of increasing |
2333 | 663 precedence.\vskip0.75ex}\span\cr |
664 ;\ \ ,&statement separators\cr | |
665 =&assignment, groups left to right\cr | |
666 ||\ \ \&\&&logical ``or'' and ``and''\cr | |
667 |\ \ \&&element-wise ``or'' and ``and''\cr | |
668 < <= == >= > !=&relational operators\cr | |
669 :&colon\cr | |
670 +\ \ -&addition and subtraction\cr | |
671 * / \char'134\ \ .*\ \ ./\ \ .\char'134&multiplication and division\cr | |
672 '\ \ .'&transpose\cr | |
673 +\ \ -\ \ ++\ \ --\ \ !&unary minus, increment, logical ``not''\cr | |
674 \char'136\ \ .\char'136&exponentiation\cr | |
675 \endsec | |
676 | |
677 \vfill\eject | |
678 | |
7040 | 679 \sec Paths and Packages; |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
680 path&display the current Octave function path.\cr |
7040 | 681 pathdef&display the default path.\cr |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
682 addpath ({\it dir})&add a directory to the path.\cr |
7040 | 683 EXEC\_PATH&manipulate the Octave executable path.\cr |
684 pkg list&display installed packages.\cr | |
685 pkg load {\it pack}&Load an installed package.\cr | |
686 \endsec | |
687 | |
688 \sec Cells and Structures; | |
689 {\it{var}}.{\it{field}} = ...&set a field of a structure.\cr | |
690 {\it{var}}$\{${\it{idx}}$\}$ = ...&set an element of a cell array.\cr | |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
691 cellfun ({\it f}, {\it c})&apply a function to elements of cell array.\cr |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
692 fieldnames ({\it s})&returns the fields of a structure.\cr |
7040 | 693 \endsec |
694 | |
2333 | 695 \widesec Statements; |
696 for {\it identifier} = {\it expr} {\it stmt-list} endfor\cr | |
697 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
698 Execute {\it stmt-list} once for each column of {\it expr}. The | |
699 variable {\it identifier} is set to the value of the current column | |
700 during each iteration.}\cr\cr | |
701 while ({\it condition}) {\it stmt-list} endwhile\cr | |
702 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
703 Execute {\it stmt-list} while {\it condition} is true.}\cr\cr | |
704 \hbox{\vtop{\hsize=\itmwid\tt break} | |
705 \vtop{\hsize=\dfnwid\rm exit innermost loop}}\cr | |
706 \hbox{\vtop{\hsize=\itmwid\tt continue} | |
707 \vtop{\hsize=\dfnwid\rm go to beginning of innermost loop}}\cr | |
708 \hbox{\vtop{\hsize=\itmwid\tt return} | |
709 \vtop{\hsize=\dfnwid\rm return to calling function}}\cr\cr | |
710 if ({\it condition}) {\it if-body} \opt{{\tt else} {\it else-body}} endif\cr | |
711 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
712 Execute {\it if-body} if {\it condition} is true, otherwise execute | |
713 {\it else-body}.}\cr | |
714 if ({\it condition}) {\it if-body} \opt{{\tt elseif} ({\it condition}) | |
715 {\it elseif-body}} endif\cr | |
716 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
717 Execute {\it if-body} if {\it condition} is true, otherwise execute | |
718 the {\it elseif-body} corresponding to the first {\tt elseif} | |
719 condition that is true, otherwise execute {\it else-body}.}\cr | |
720 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
721 Any number of {\tt elseif} clauses may appear in an {\tt if} | |
722 statement.}\cr\cr | |
723 unwind\_protect {\it body} unwind\_protect\_cleanup {\it cleanup} end\cr | |
724 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
725 Execute {\it body}. Execute {\it cleanup} no matter how control | |
726 exits {\it body}.}\cr | |
7040 | 727 try {\it body} catch {\it cleanup} end\cr |
728 \hfill\vbox{\hsize=\idnwid\rm\vskip0.25ex | |
729 Execute {\it body}. Execute {\it cleanup} if {\it body} fails.}\cr | |
730 \endsec | |
731 | |
732 \altsec Strings; | |
733 strcmp ({\it s}, {\it t})&compare strings\cr | |
734 strcat ({\it s}, {\it t}, ...)&concatenate strings\cr | |
735 regexp ({\it str}, {\it pat})&strings matching regular expression\cr | |
736 regexprep ({\it str}, {\it pat}, {\it rep})&Match and replace sub-strings\cr | |
2333 | 737 \endsec |
738 | |
739 \widesec Defining Functions; | |
740 function \opt{{\it ret-list}} {\it function-name} | |
741 \opt{\hskip0.2em({\it arg-list})\hskip0.2em}\cr | |
742 \quad{\it function-body}\cr | |
743 endfunction\cr\cr | |
744 {\rm {\it ret-list\/} may be a single identifier or a comma-separated | |
745 list of identifiers delimited by square-brackets.\vskip0.75ex}\cr | |
746 {\rm {\it arg-list\/} is a comma-separated list of identifiers and may | |
747 be empty.}\cr | |
748 \endsec | |
749 | |
7040 | 750 \vfill\eject |
751 | |
752 \sec Function Handles; | |
753 @{\it{func}}& Define a function handle to {\it func}.\cr | |
754 @({\it var1}, ...) {\it expr}&Define an anonymous function handle.\cr | |
755 str2func ({\it str})&Create a function handle from a string.\cr | |
756 functions ({\it handle})&Return information about a function handle.\cr | |
757 func2str ({\it handle})&Return a string representation of a | |
758 function handle.\cr | |
759 {\it handle} ({\it arg1}, ...)&Evaluate a function handle.\cr | |
760 feval ({\it func}, {\it arg1}, ...)&Evaluate a function handle or | |
761 string, passing remaining args to {\it func}\cr | |
762 \omit\vbox{\rm\vskip0.25ex | |
763 Anonymous function handles take a copy of the variables in the | |
764 current workspace.\vskip0.75ex}\span\cr | |
765 \endsec | |
766 | |
767 \sec Miscellaneous Functions; | |
768 eval ({\it str})&evaluate {\it str} as a command\cr | |
769 error ({\it message})&print message and return to top level\cr | |
770 warning ({\it message})&print a warning message\cr | |
771 clear {\it pattern}&clear variables matching pattern\cr | |
772 exist ({\it str})&check existence of variable or function\cr | |
773 who, whos&list current variables\cr | |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
774 whos {\it var}&details of the variable {\it var}\cr |
7040 | 775 \endsec |
776 | |
2333 | 777 \sec Basic Matrix Manipulations; |
778 rows ({\it a})&return number of rows of {\it a}\cr | |
779 columns ({\it a})&return number of columns of {\it a}\cr | |
780 all ({\it a})&check if all elements of {\it a\/} nonzero\cr | |
781 any ({\it a})&check if any elements of {\it a\/} nonzero\cr | |
7040 | 782 \endsec |
783 | |
784 \sec ; | |
2333 | 785 find ({\it a})&return indices of nonzero elements\cr |
786 sort ({\it a})&order elements in each column of {\it a}\cr | |
787 sum ({\it a})&sum elements in columns of {\it a}\cr | |
788 prod ({\it a})&product of elements in columns of {\it a}\cr | |
789 min ({\it args})&find minimum values\cr | |
790 max ({\it args})&find maximum values\cr | |
791 rem ({\it x}, {\it y})&find remainder of {\it x}/{\it y}\cr | |
792 reshape ({\it a}, {\it m}, {\it n})&reformat {\it a} to be {\it m} by | |
7040 | 793 {\it n}\cr |
2333 | 794 diag ({\it v}, {\it k})&create diagonal matrices\cr |
795 linspace ({\it b}, {\it l}, {\it n})&create vector of linearly-spaced | |
796 elements\cr | |
797 logspace ({\it b}, {\it l}, {\it n})&create vector of log-spaced | |
798 elements\cr | |
799 eye ({\it n}, {\it m})&create {\it n\/} by {\it m\/} identity matrix\cr | |
800 ones ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of ones\cr | |
801 zeros ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of zeros\cr | |
802 rand ({\it n}, {\it m})&create {\it n\/} by {\it m\/} matrix of random | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
803 values\cr |
2333 | 804 \endsec |
805 | |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
806 % sin ({\it a}) cos({\it a}) tan({\it a})&trigonometric functions\cr |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
807 % asin ({\it a}) acos({\it a}) atan({\it a})&inverse trigonometric functions\cr |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
808 % sinh ({\it a}) cosh({\it a}) tanh({\it a})&hyperbolic trig functions\cr |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
809 % asinh ({\it a}) acosh({\it a}) atanh({\it a})&inverse hyperbolic trig |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
810 % functions\cr\cr |
2333 | 811 |
812 \sec Linear Algebra; | |
813 chol ({\it a})&Cholesky factorization\cr | |
814 det ({\it a})&compute the determinant of a matrix\cr | |
815 eig ({\it a})&eigenvalues and eigenvectors\cr | |
816 expm ({\it a})&compute the exponential of a matrix\cr | |
817 hess ({\it a})&compute Hessenberg decomposition\cr | |
818 inverse ({\it a})&invert a square matrix\cr | |
819 norm ({\it a}, {\it p})&compute the {\it p}-norm of a matrix\cr | |
820 pinv ({\it a})&compute pseudoinverse of {\it a}\cr | |
821 qr ({\it a})&compute the QR factorization of a matrix\cr | |
822 rank ({\it a})&matrix rank\cr | |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
823 sprank ({\it a})&structural matrix rank\cr |
2333 | 824 schur ({\it a})&Schur decomposition of a matrix\cr |
825 svd ({\it a})&singular value decomposition\cr | |
826 syl ({\it a}, {\it b}, {\it c})&solve the Sylvester equation\cr | |
827 \endsec | |
828 | |
7040 | 829 \vfill\eject |
830 | |
2333 | 831 \sec Equations, ODEs, DAEs, Quadrature; |
832 *fsolve&solve nonlinear algebraic equations\cr | |
833 *lsode&integrate nonlinear ODEs\cr | |
834 *dassl&integrate nonlinear DAEs\cr | |
7040 | 835 *quad&integrate nonlinear functions\cr |
2333 | 836 perror ({\it nm}, {\it code})&for functions that return numeric |
837 codes, print error message for named function and given error | |
838 code\cr\cr | |
839 \omit \vbox{\rm | |
840 {\tt *} See the on-line or printed manual for the complete list of | |
841 arguments for these functions.}\span\cr | |
842 \endsec | |
843 | |
7040 | 844 % \altsec Sets; |
845 % create\_set ({\it a}, {\it b})&create row vector of unique values\cr | |
846 % complement ({\it a}, {\it b})&elements of {\it b} not in {\it a}\cr | |
847 % intersection ({\it a}, {\it b})&intersection of sets {\it a} and {\it b}\cr | |
848 % union ({\it a}, {\it b})&union of sets {\it a} and {\it b}\cr | |
849 % \endsec | |
850 | |
2333 | 851 \sec Signal Processing; |
7040 | 852 fft ({\it a})&Fast Fourier Transform using FFTW\cr |
853 ifft ({\it a})&inverse FFT using FFTW\cr | |
2333 | 854 freqz ({\it args})&FIR filter frequency response\cr |
7040 | 855 filter ({\it a}, {\it b}, {\it x})&filter by transfer function\cr |
856 conv ({\it a}, {\it b})&convolve two vectors\cr | |
10734
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
857 hamming ({\it n})&return Hamming window coefficients\cr |
551913ba1f85
Fix typos in refcard (bug #30260).
Rik <octave@nomad.inbox5.com>
parents:
9322
diff
changeset
|
858 hanning ({\it n})&return Hanning window coefficients\cr |
2333 | 859 \endsec |
860 | |
861 \altsec Image Processing; | |
862 colormap ({\it map})&set the current colormap\cr | |
863 gray2ind ({\it i}, {\it n})&convert gray scale to Octave image\cr | |
864 image ({\it img}, {\it zoom})&display an Octave image matrix\cr | |
865 imagesc ({\it img}, {\it zoom})&display scaled matrix as image\cr | |
12909
abb33ad310e6
doc: Change references to removed loadimage->imread and deprecated saveimage->imwrite
Andreas Weber <andy.weber.aw@gmail.com>
parents:
11523
diff
changeset
|
866 imread ({\it file})&load an image file\cr |
2333 | 867 imshow ({\it img}, {\it map})&display Octave image\cr |
868 imshow ({\it i}, {\it n})&display gray scale image\cr | |
869 imshow ({\it r}, {\it g}, {\it b})&display RGB image\cr | |
12909
abb33ad310e6
doc: Change references to removed loadimage->imread and deprecated saveimage->imwrite
Andreas Weber <andy.weber.aw@gmail.com>
parents:
11523
diff
changeset
|
870 imwrite ({\it img}, {\it file})&write images in various file formats\cr |
2333 | 871 ind2gray ({\it img}, {\it map})&convert Octave image to gray scale\cr |
872 ind2rgb ({\it img}, {\it map})&convert indexed image to RGB\cr | |
873 rgb2ind ({\it r}, {\it g}, {\it b})&convert RGB to Octave image\cr | |
874 save a matrix to {\it file}\span\cr | |
875 \endsec | |
876 | |
877 \altsec C-style Input and Output; | |
878 fopen ({\it name}, {\it mode})&open file {\it name}\cr | |
879 fclose ({\it file})&close {\it file}\cr | |
880 printf ({\it fmt}, ...)&formatted output to {\tt stdout}\cr | |
881 fprintf ({\it file}, {\it fmt}, ...)&formatted output to {\it file}\cr | |
882 sprintf ({\it fmt}, ...)&formatted output to string\cr | |
883 scanf ({\it fmt})&formatted input from {\tt stdin}\cr | |
884 fscanf ({\it file}, {\it fmt})&formatted input from {\it file}\cr | |
885 sscanf ({\it str}, {\it fmt})&formatted input from {\it string}\cr | |
886 fgets ({\it file}, {\it len})&read {\it len\/} characters from {\it file\/}\cr | |
887 fflush ({\it file})&flush pending output to {\it file}\cr | |
888 ftell ({\it file})&return file pointer position\cr | |
889 frewind ({\it file})&move file pointer to beginning\cr | |
890 freport&print a info for open files\cr | |
891 fread ({\it file}, {\it size}, {\it prec})&read binary data files\cr | |
892 fwrite ({\it file}, {\it size}, {\it prec})&write binary data files\cr | |
893 feof ({\it file})&determine if pointer is at EOF\cr | |
894 \omit \vbox{\rm\vskip0.75ex | |
895 A file may be referenced either by name or by the number returned | |
896 from {\tt fopen}. Three files are preconnected when Octave starts: | |
897 {\tt stdin}, {\tt stdout}, and {\tt stderr}.\vskip0.75ex}\span\cr | |
898 \endsec | |
899 | |
900 \sec Other Input and Output functions; | |
901 save {\it file} {\it var} ...&save variables in {\it file}\cr | |
902 load {\it file}&load variables from {\it file}\cr | |
903 disp ({\it var})&display value of {\it var} to screen\cr | |
904 \endsec | |
905 | |
7040 | 906 \vfill\eject |
2333 | 907 |
908 \sec Polynomials; | |
909 compan ({\it p})&companion matrix\cr | |
910 conv ({\it a}, {\it b})&convolution\cr | |
911 deconv ({\it a}, {\it b})&deconvolve two vectors\cr | |
912 poly ({\it a})&create polynomial from a matrix\cr | |
913 polyderiv ({\it p})&derivative of polynomial\cr | |
914 polyreduce ({\it p})&integral of polynomial\cr | |
915 polyval ({\it p}, {\it x})&value of polynomial at {\it x}\cr | |
916 polyvalm ({\it p}, {\it x})&value of polynomial at {\it x}\cr | |
917 roots ({\it p})&polynomial roots\cr | |
918 residue ({\it a}, {\it b})&partial fraction expansion of | |
919 ratio {\it a}/{\it b}\cr | |
920 \endsec | |
921 | |
922 \sec Statistics; | |
923 corrcoef ({\it x}, {\it y})&correlation coefficient\cr | |
924 cov ({\it x}, {\it y})&covariance\cr | |
925 mean ({\it a})&mean value\cr | |
926 median ({\it a})&median value\cr | |
927 std ({\it a})&standard deviation\cr | |
928 var ({\it a})&variance\cr | |
929 \endsec | |
930 | |
6548 | 931 \sec Plotting Functions; |
2333 | 932 plot ({\it args})&2D plot with linear axes\cr |
6548 | 933 plot3 ({\it args})&3D plot with linear axes\cr |
934 line ({\it args})&2D or 3D line\cr | |
7040 | 935 patch ({\it args})&2D patch\cr |
2333 | 936 semilogx ({\it args})&2D plot with logarithmic x-axis\cr |
937 semilogy ({\it args})&2D plot with logarithmic y-axis\cr | |
938 loglog ({\it args})&2D plot with logarithmic axes\cr | |
939 bar ({\it args})&plot bar charts\cr | |
940 stairs ({\it x}, {\it y})&plot stairsteps\cr | |
10737
5faf6832855a
refcard.tex: Fix italic macro typo for stem.
Rik <octave@nomad.inbox5.com>
parents:
10734
diff
changeset
|
941 stem ({\it x}, {\it y})&plot a stem graph\cr |
7040 | 942 hist ({\it y}, {\it x})&plot histograms\cr |
943 contour ({\it x}, {\it y}, {\it z})&contour plot\cr | |
944 title ({\it string})&set plot title\cr | |
2333 | 945 axis ({\it limits})&set axis ranges\cr |
946 xlabel ({\it string})&set x-axis label\cr | |
947 ylabel ({\it string})&set y-axis label\cr | |
6548 | 948 zlabel ({\it string})&set z-axis label\cr |
7040 | 949 text ({\it x}, {\it y}, {\it str})&add text to a plot\cr |
6548 | 950 legend ({\it string})&set label in plot key\cr |
2333 | 951 grid \opt{on$|$off}&set grid state\cr |
952 hold \opt{on$|$off}&set hold state\cr | |
7040 | 953 ishold&return 1 if hold is on, 0 otherwise\cr |
2333 | 954 mesh ({\it x}, {\it y}, {\it z})&plot 3D surface\cr |
7040 | 955 meshgrid ({\it x}, {\it y})&create mesh coordinate matrices\cr |
2333 | 956 \endsec |
957 | |
958 \vskip 0pt plus 2fill | |
959 \hrule width \hsize | |
960 \par\vskip10pt | |
961 {\smrm\parskip=6pt | |
7040 | 962 Edition \refcardedition\ for Octave Version \octaveversion. Copyright |
6548 | 963 1996, 2007, John W. Eaton |
9322 | 964 (jwe@octave.org). The author assumes no responsibility for any |
2333 | 965 errors on this card. |
966 | |
967 This card may be freely distributed under the terms of the GNU | |
968 General Public License. | |
969 | |
970 \TeX{} Macros for this card by Roland Pesch (pesch@cygnus.com), | |
971 originally for the GDB reference card | |
972 | |
973 Octave itself is free software; you are welcome to distribute copies of | |
974 it under the terms of the GNU General Public License. There is | |
975 absolutely no warranty for Octave. | |
976 } | |
977 | |
978 \end | |
979 | |
980 % For AUCTeX: | |
981 % | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
982 % Local Variables: |
2333 | 983 % mode: tex |
984 % TeX-master: t | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
985 % End: |