Mercurial > octave
annotate doc/refcard/refcard.tex @ 31272:3e4b9ecc031c
doc: More changes to refcard.tex
refcard.tex: Add switch-case, add classdef,
consolidate several sections into one to make space for content,
add more functions, add note about how to discover more functions,
fixed two formatting issues.
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Fri, 07 Oct 2022 13:39:08 -0400 |
parents | af3752d9a59f |
children | d8d2b5661082 |
rev | line source |
---|---|
2333 | 1 % refcard.tex |
2 % | |
3 % This file is TeX source for a reference card describing Octave. | |
4 % | |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
5 % Copyright (C) 1996-2022 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
6 % |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 % See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 % distribution or <https://octave.org/copyright/>. |
2333 | 9 % |
7016 | 10 % This file is part of Octave. |
11 % | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 % Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 % under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
14 % the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
15 % (at your option) any later version. |
2333 | 16 % |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 % Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 % WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
19 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
20 % GNU General Public License for more details. |
2333 | 21 % |
7016 | 22 % You should have received a copy of the GNU General Public License |
23 % along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
24 % <https://www.gnu.org/licenses/>. |
2333 | 25 % |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
26 % |
7018 | 27 % Heavily modified by jwe from the source for the gdb reference card, |
27956
2310164737b3
fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
28 % which was originally written by Roland Pesch <pesch@cygnus.com>. |
7018 | 29 % |
30 % Copyright (C) 1991, 1992 Free Software Foundation, Inc. | |
31 % Permission is granted to make and distribute verbatim copies of | |
32 % this reference provided the copyright notices and permission notices | |
33 % are preserved on all copies. | |
34 % | |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
35 % |
7018 | 36 % TeX markup is a programming language; accordingly this file is source |
37 % for a program to generate a reference. | |
38 % | |
2333 | 39 % You only have to set the total width and height of the paper, the |
40 % horizontal and vertical margin space measured from *paper edge* | |
41 % and the interline and interspec spacing. | |
42 % In order to support a new papersize, you have to fiddle with the | |
43 % latter four dimensions. Just try out a few values. | |
44 % All other values will be computed at process time so it should be | |
45 % quite easy to support different paper sizes - only four values to | |
46 % guess :-) | |
47 % | |
48 % To find the configuration places, just search for the string | |
49 % "User configuration". | |
50 % | |
51 % -- Andreas Vogel (av@ssw.de) | |
52 % | |
53 % NOTE ON INTENTIONAL OMISSIONS: This reference card includes many | |
54 % Octave commands, but due to space constraints there are some things | |
55 % I chose to omit. In general, not all synonyms for commands are | |
56 % covered, nor all variations of a command. | |
57 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
58 \def\octaveversion{8.0.0} |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
59 \def\refcardedition{3.1} |
2333 | 60 |
61 % ------------------ | |
62 % multicolumn format | |
63 % ------------------ | |
64 | |
65 % Declarations (these must come first) | |
66 | |
67 \newdimen\totalwidth | |
68 \newdimen\totalheight | |
69 \newdimen\hmargin | |
70 \newdimen\vmargin | |
71 \newdimen\secskip | |
72 \newdimen\lskip | |
73 \newdimen\barwidth | |
74 \newdimen\barheight | |
75 \newdimen\intersecwidth | |
76 | |
77 \newcount\columnsperpage | |
78 | |
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
80 % % | |
81 % CONFIGURATION % | |
82 % % | |
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
84 | |
85 % There are currently 8 total columns, so some of these options will | |
86 % not create a single page reference card. | |
87 | |
88 % Choose a paper size. Default is US letter size. | |
89 | |
90 \def\refcardafoursize{a4} % 3 columns, A4 paper (1 in = 254 mm) | |
91 \def\refcardlegalsize{legal} % 4 columns, US legal paper (8.5 x 14in) | |
4893 | 92 \def\refcardlettersize{letter} % 3 columns, US letter paper (8.5 x 11in) |
2333 | 93 |
94 \ifx\refcardsize\refcardafoursize | |
95 \columnsperpage=3 % total number of columns to typeset | |
96 \totalwidth=297mm % total width of paper | |
97 \totalheight=210mm % total height of paper | |
98 \hmargin=9mm % horizontal margin width | |
99 \vmargin=7mm % vertical margin width | |
100 \secskip=3mm % space between refcard secs | |
101 \lskip=0.4mm % extra skip between \sec entries | |
102 \else | |
103 \ifx\refcardsize\refcardlegalsize | |
104 \columnsperpage=4 % total number of columns to typeset | |
105 \totalwidth=14in % total width of paper | |
106 \totalheight=8.5in % total height of paper | |
107 \hmargin=0.20in % horizontal margin width | |
108 \vmargin=0.25in % vertical margin width | |
109 \secskip=0.75pc % space between refcard secs | |
110 \lskip=2pt % extra skip between \sec entries | |
111 \else | |
112 \columnsperpage=3 % total number of columns to typeset | |
113 \totalwidth=11in % total width of paper | |
114 \totalheight=8.5in % total height of paper | |
115 \hmargin=0.25in % horizontal margin width | |
116 \vmargin=0.25in % vertical margin width | |
117 \secskip=0.75pc % space between refcard secs | |
118 \lskip=2pt % extra skip between \sec entries | |
119 \fi | |
120 \fi | |
121 | |
4489 | 122 \ifx\pdfoutput\undefined |
123 \else | |
124 \pdfpageheight=\totalheight | |
4866 | 125 \pdfpagewidth=\totalwidth |
4489 | 126 \fi |
127 | |
2333 | 128 % Change according to personal taste, not papersize dependent. |
129 | |
130 \barwidth=.1pt % width of the cropmark bar | |
131 \barheight=2pt % height of the cropmark bar | |
132 \intersecwidth=0.5em % width between \itmwid and \dfnwid | |
133 | |
134 % Uncomment only one of the following definitions for folding guides. | |
135 | |
136 % No printed folding guide: | |
137 | |
138 %\def\vdecor{\hskip\hmargin plus1fil | |
139 % \hskip\barwidth plus1fil | |
140 % \hskip\hmargin plus1fil} | |
141 | |
142 % Solid line folding guide: | |
143 | |
144 %\def\vdecor{\hskip\hmargin plus1fil% | |
145 % \vrule width \barwidth% | |
146 % \hskip\hmargin plus1fil} | |
147 | |
148 % For small marks near top and bottom as folding guide: | |
149 | |
150 \def\vdecor{\hskip\hmargin plus1fil% | |
151 \vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}% | |
152 \vfill | |
153 \hbox to \barwidth{\vrule height\barheight width\barwidth}}% | |
154 \hskip\hmargin plus1fil} | |
155 | |
156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
157 % % | |
158 % END CONFIGURATION % | |
159 % % | |
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
161 | |
162 % values to be computed based on above definitions. | |
163 % nothing to configure | |
164 | |
165 \newdimen\fullhsize % width of area without margins | |
166 \newdimen\itmwid % width of item column | |
167 \newdimen\dfnwid % width of definition column | |
168 \newdimen\idnwid % width of indented text | |
169 \newdimen\temp % only for temporary use | |
170 | |
171 % an alternate section format, used in some cases to make text fit better. | |
172 | |
173 \newdimen\altitmwid % width of item column in altsec | |
174 \newdimen\altdfnwid % width of definition column in altsec | |
175 | |
176 % Subtract hmargin for left and right sides of paper from full width. | |
177 % | |
178 % fullhsize = totalwidth - (2 * hmargin) | |
179 | |
180 \fullhsize=\totalwidth | |
181 \temp=\hmargin | |
182 \multiply \temp by 2 | |
183 \advance \fullhsize by -\temp | |
184 | |
185 % intercolumn space is composed of hmargin barwidth hmargin so that we | |
186 % get the same amount of space on either side of the (optional) rule | |
187 % between columns. For N columns, we need to subtract this amount of | |
188 % space N-1 times. Divide by the number of columns to get the final | |
189 % value of \hsize that we use to typeset columns. | |
190 | |
191 % hsize = (fullhsize - (ncols-1)*barwidth - 2*(ncols-1)*hmargin) / ncols | |
192 | |
193 \newcount\tmpcnt | |
194 \tmpcnt\columnsperpage | |
195 \advance \tmpcnt by -1 | |
196 | |
197 \hsize=\fullhsize | |
198 | |
199 \temp=\barwidth | |
200 \multiply \temp by \tmpcnt | |
201 \advance \hsize by -\temp | |
202 | |
203 \multiply \tmpcnt by 2 | |
204 | |
205 \temp=\hmargin | |
206 \multiply \temp by \tmpcnt | |
207 \advance \hsize by -\temp | |
208 | |
209 \divide \hsize by \columnsperpage | |
210 | |
211 % Vertical size is easy -- same amount of space above and below. | |
212 % | |
213 % vsize = totalheight - (2 * vmargin) | |
214 | |
215 \vsize=\totalheight | |
216 \temp=\vmargin | |
217 \multiply \temp by 2 | |
218 \advance \vsize by -\temp | |
219 | |
220 % adjust the offsets so the margins are measured *from paper edge* | |
221 | |
222 \hoffset=-1in \advance \hoffset by \hmargin | |
223 \voffset=-1in \advance \voffset by \vmargin | |
224 | |
225 % Width of items in a section. | |
226 | |
227 % itmwid = (hsize - intersecwidth) * 1/3 | |
228 % dfnwid = (hsize - intersecwidth) * 2/3 | |
229 | |
230 % width of the item | |
231 | |
232 \temp=\hsize | |
233 \advance \temp by -\intersecwidth | |
234 \divide \temp by 3 | |
235 \itmwid=\temp | |
236 | |
237 % width of the corresponding definition | |
238 | |
239 \dfnwid=\hsize | |
240 \advance \dfnwid by -\itmwid | |
241 | |
242 % indentation for sub items, etc. | |
243 | |
244 \temp=\hsize \advance\temp by -1em | |
245 \idnwid=\temp | |
246 | |
247 % Width of items in an alt section. | |
248 | |
249 \altitmwid=\itmwid \advance \altitmwid by 0.35in | |
250 \altdfnwid=\dfnwid \advance \altdfnwid by -0.35in | |
251 | |
252 % Output macros. | |
253 % | |
254 % Strategy: | |
255 % | |
256 % * set each column in a box | |
257 % * append new columns in a global `holding' box, inserting | |
258 % intercolumn decorations as necessary. | |
259 % * when we fill a page, dump the saved box and the latest column, | |
260 % separated by the intercolumn decoration. | |
261 | |
262 \newbox\holdbox | |
263 \newcount\colno | |
264 \colno=0 | |
265 | |
266 \output={\relax | |
267 \global\advance\colno by 1 | |
268 \ifnum\colno=1 | |
269 \global\setbox\holdbox=\columnbox | |
270 \else | |
271 \ifnum\colno=\columnsperpage | |
272 \shipout\hbox to \fullhsize{\box\holdbox\vdecor\columnbox} | |
273 \advancepageno | |
274 \global\colno=0 | |
275 \else | |
276 \global\setbox\holdbox=\vbox{\hbox{\box\holdbox\vdecor\columnbox}} | |
277 \fi | |
278 \fi} | |
279 | |
280 \def\columnbox{\leftline{\pagebody}} | |
281 | |
282 \def\bye{\par\vfill | |
283 \supereject | |
284 \if R\lcr \null\vfill\eject \fi | |
285 \end} | |
286 | |
287 % ----- | |
288 % Fonts | |
289 % ----- | |
290 | |
291 \font\bbf=cmbx10 | |
292 \font\vbbf=cmbx12 | |
293 \font\smrm=cmr6 | |
294 \font\brm=cmr10 | |
295 \font\rm=cmr7 | |
296 \font\it=cmti7 | |
297 \font\tt=cmtt8 | |
298 | |
299 % We can afford to allow some slop | |
300 | |
301 \hfuzz=1pt | |
302 \vfuzz=1pt | |
303 \hyphenpenalty=5000 | |
304 \tolerance=2000 | |
305 \raggedright | |
306 \raggedbottom | |
307 \normalbaselineskip=9pt | |
308 \baselineskip=9pt | |
309 | |
310 \parindent=0pt | |
311 \parskip=0pt | |
312 \footline={\vbox to0pt{\hss}} | |
313 | |
314 \def\ctl#1{{\tt C-#1}} | |
315 \def\opt#1{{\brm[{\rm #1}]}} | |
316 \def\xtra#1{\noalign{\smallskip{\tt#1}}} | |
317 | |
318 % A normal section | |
319 | |
320 \long\def\sec#1;#2\endsec{\vskip \secskip | |
321 \halign{% | |
322 % | |
323 % column 1 (of halign): | |
324 % | |
325 \vtop{\hsize=\itmwid\tt ##\par\vskip \lskip }\hfil | |
326 % | |
327 % column 2 (of halign): | |
328 % | |
329 &\vtop{% | |
330 \hsize=\dfnwid | |
331 \hangafter=1 | |
332 \hangindent=\intersecwidth | |
333 \rm ##\par\vskip \lskip}\cr | |
334 % | |
335 % Tail of \long\def fills in halign body with \sec args: | |
336 % | |
337 \noalign{{\bbf #1}% | |
338 \vskip \lskip} | |
339 #2}} | |
340 | |
341 \long\def\widesec#1;#2\endsec{\vskip \secskip | |
342 \halign{% | |
343 % | |
344 % column 1 (of halign): | |
345 % | |
346 \vbox{\tt | |
347 ##\par\vskip \lskip }\cr | |
348 % | |
349 % Tail of \long\def fills in halign body with \sec args: | |
350 % | |
351 \noalign{{\bbf #1}\vskip 3\lskip} | |
352 #2}} | |
353 | |
354 % an alternate section format, used in some cases to make text fit better. | |
355 | |
356 \long\def\altsec#1;#2\endsec{\vskip \secskip | |
357 \halign{% | |
358 % | |
359 % column 1 (of halign): | |
360 % | |
361 \vtop{\hsize=\altitmwid\tt | |
362 ##\par\vskip \lskip}\hfil | |
363 % | |
364 % column 2 (of halign): | |
365 % | |
366 &\vtop{% | |
367 \hsize=\altdfnwid | |
368 \hangafter=1 | |
369 \hangindent=\intersecwidth | |
370 \rm ##\par\vskip \lskip}\cr | |
371 % | |
372 % Tail of \long\def fills in halign body with \sec args: | |
373 % | |
374 \noalign{{\bbf #1}\vskip \lskip} | |
375 #2}} | |
376 | |
377 % ------------------------------------- | |
378 % The actual text of the reference card | |
379 % ------------------------------------- | |
380 | |
381 {\vbbf Octave Quick Reference}\hfil{\smrm Octave Version \octaveversion}\qquad | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
382 \centerline{\smrm Copyright 1996-2022 The Octave Project Developers |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
383 \qquad Permissions on back} |
2333 | 384 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
385 \sec Starting And Stopping; |
2333 | 386 octave&start interactive Octave session\cr |
387 octave {\it file}&run Octave on commands in {\it file}\cr | |
7040 | 388 octave --eval {\it code}&Evaluate {\it code} using Octave\cr |
2333 | 389 octave --help&describe command line options\cr |
390 quit {\rm or} exit&exit Octave\cr | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
391 Ctrl-C&terminate current command and return to top-level prompt\cr |
2333 | 392 \endsec |
393 | |
394 \sec Getting Help; | |
395 help {\it command}&briefly describe {\it command}\cr | |
7040 | 396 doc&use Info to browse Octave manual\cr |
397 doc {\it command}&search for {\it command} in Octave manual\cr | |
398 lookfor {\it str}&search for {\it command} based on {\it str}\cr | |
2333 | 399 \endsec |
400 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
401 \sec Command Completion and History; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
402 TAB&complete a command or variable name\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
403 Alt-?&list possible completions\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
404 Ctrl-r, Ctrl-s&search command history\cr |
2333 | 405 \endsec |
406 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
407 \sec Directory and Path Commands; |
2333 | 408 cd {\it dir}&change working directory to {\it dir}\cr |
409 pwd&print working directory\cr | |
410 ls \opt{{\it options}}&print directory listing\cr | |
411 getenv ({\it string})&return value of named environment variable\cr | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
412 what&list .m and .mat files in the current directory\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
413 path&display the current Octave function path\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
414 pathdef&display the default path\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
415 addpath ({\it dir})&add a directory to the path\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
416 EXEC\_PATH&manipulate the Octave executable path\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
417 \endsec |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
418 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
419 \sec Package Management; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
420 pkg install -forge&download and install package\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
421 pkg install &install an already downloaded package\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
422 pkg list&display installed packages\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
423 pkg load / pkg unload &Load and unload an installed package\cr |
2333 | 424 \endsec |
425 | |
426 \sec Matrices; | |
427 \omit\vbox{\rm\vskip0.25ex | |
428 Square brackets delimit literal matrices. Commas separate elements | |
429 on the same row. Semicolons separate rows. Commas may be replaced | |
430 by spaces, and semicolons may be replaced by one or more newlines. | |
7040 | 431 Elements of a matrix may be arbitrary expressions, assuming |
2333 | 432 all the dimensions agree.\vskip0.75ex}\span\cr |
433 [ {\it x}, {\it y}, ... ]&enter a row vector\cr | |
434 [ {\it x}; {\it y}; ... ]&enter a column vector\cr | |
435 [ {\it w}, {\it x}; {\it y}, {\it z} ]&enter a 2$\times$2 matrix\cr | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
436 rows&number of rows of matrix\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
437 columns&number of columns of matrix\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
438 zeros&create matrix of zeros\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
439 ones&create matrix of ones\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
440 eye&create identity matrix\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
441 diag&create diagonal matrix\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
442 rand randi randn&create matrix of random values\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
443 all&true if all elements nonzero\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
444 any&true if at least one element nonzero\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
445 nnz &ount nonzero elements\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
446 sparse&create a sparse matrix\cr |
2333 | 447 \endsec |
448 | |
7040 | 449 \sec Multi-dimensional Arrays; |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
450 cat&concatenate along a given dimension\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
451 reshape&change the shape of an array\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
452 squeeze&remove singleton dimensions\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
453 ndims&number of dimensions\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
454 permute, ipermute, shiftdim&like N-dimensional transpose\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
455 circshift&cyclically shift array elements\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
456 meshgrid&matrices useful for vectorization\cr |
7040 | 457 \endsec |
458 | |
2333 | 459 \sec Ranges; |
460 {\it base} : {\it limit}\cr | |
461 {\it base} : {\it incr} : {\it limit}\cr | |
462 \omit\hfill\vbox{\hsize=\idnwid\rm\vskip0.75ex | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
463 {\it incr} == 1 if not specified. Negative ranges allowed.}\span\cr |
2333 | 464 \endsec |
465 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
466 \sec Numeric Types And Values; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
467 \omit\vbox{\rm\vskip0.5ex |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
468 Integers saturate in Octave. They do not wrap around. |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
469 \vskip0.75ex}\span\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
470 int8 int16 int32 int64&Signed integers\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
471 uint8 uint16 uint32 uint64&Unsigned integers\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
472 single double&32-bit / 64-bit IEEE floating point\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
473 intmin intmax, flintmax&Integer limits of given type\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
474 realmax realmin&Floating point limits of given type\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
475 inf nan NA&IEEE infinity, NaN, missing value\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
476 eps&machine precision\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
477 pi e&3.14159..., 2.71828...\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
478 i j&$\sqrt{-1}$\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
479 \endsec |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
480 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
481 \sec Strings; |
2333 | 482 \omit\vbox{\rm\vskip0.5ex |
483 A {\it string constant\/} consists of a sequence of characters | |
7040 | 484 enclosed in either double-quote or single-quote marks. Strings |
485 in double-quotes allow the use of the escape sequences below. | |
486 \vskip0.75ex}\span\cr | |
2333 | 487 \char'134\char'134&a literal backslash\cr |
488 \char'134 "&a literal double-quote character\cr | |
489 \char'134 '&a literal single-quote character\cr | |
490 \char'134 n&newline, ASCII code 10\cr | |
491 \char'134 t&horizontal tab, ASCII code 9\cr | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
492 sprintf sscanf&formatted IO to/from string\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
493 strcmp&compare strings\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
494 strcat&concatenate strings\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
495 strfind regexp&find matching patterns\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
496 strrep regexprep&find and replace patterns\cr |
2333 | 497 \endsec |
498 | |
499 \sec Index Expressions; | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
500 {\it var}({\it idx})&select elements of a vector\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
501 {\it var}({\it idx1}, {\it idx2})&select elements of a matrix\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
502 {\it var}({\it [1 3]}, {\it :})&rows 1 and 3\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
503 {\it var}({\it :}, {\it [2 end]})&the second and last columns\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
504 {\it var}({\it 1:2:end}, {\it 2:2:end})&get odd rows and even columns\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
505 {\it var1}({\it var2} == 0)&elements of {\it var1} corresponding to zero |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
506 elements of {\it var2}\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
507 {\it var}({:})&all elements as a column vector\cr |
2333 | 508 \endsec |
509 | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
510 \sec Cells, Structures, and Classdefs; |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
511 {\it{var}}.{\it{field}} = ...&set a field of a structure\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
512 {\it{var}}$\{${\it{idx}}$\}$ = ...&set an element of a cell array\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
513 cellfun ({\it f}, {\it c})&apply a function to elements of cell array\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
514 fieldnames ({\it s})&returns the fields of a structure\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
515 classdef&define new classes for OOP\cr |
2333 | 516 \endsec |
517 | |
7040 | 518 \sec Assignment Expressions; |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
519 {\it var} = {\it expr}&assign value to variable\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
520 {\it var}({\it idx}) = {\it expr}&only the indexed elements are changed\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
521 {\it var}({\it idx}) = []&delete the indexed elements\cr |
7040 | 522 \endsec |
2333 | 523 |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
524 \sec Arithmetic Operators; |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
525 % |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
526 % FIXME These operators look ugly, but putting them in math mode causes |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
527 % some of them to break even more. |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
528 % |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
529 \omit \vbox{\rm\vskip0.75ex |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
530 If two operands are of different sizes, scalars and singleton dimensions are |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
531 automatically expanded. Non-singleton dimensions need to match. |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
532 \vskip0.75ex}\span\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
533 {\it x} + {\it y}, {\it x} - {\it y}&addition, subtraction\cr |
2333 | 534 {\it x} * {\it y}&matrix multiplication\cr |
535 {\it x} .* {\it y}&element by element multiplication\cr | |
536 {\it x} / {\it y}&right division, conceptually equivalent to | |
537 {\tt (inverse~(y')~*~x')'}\cr | |
538 {\it x} ./ {\it y}&element by element right division\cr | |
539 {\it x} \char'134{} {\it y}&left division, conceptually equivalent to | |
540 {\tt inverse~(x)~*~y}\cr | |
541 {\it x} .\char'134{} {\it y}&element by element left division\cr | |
542 {\it x} \char'136{} {\it y}&power operator\cr | |
543 {\it x} .\char'136{} {\it y}&element by element power operator\cr | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
544 += -= *= .*= /= ./= \char'134{}= .\char'134{}= \char'136{}= .\char'136{}=& |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
545 in-place equivalents of the above operators\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
546 -{\it x}&negation\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
547 +{\it x}&unary plus (a no-op)\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
548 {\it x}$'$&complex conjugate transpose\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
549 {\it x}.$'$&transpose\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
550 ++{\it x} --{\it x}&increment / decrement, return {\it new\/} value\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
551 {\it x}++ {\it x}--&increment / decrement, return {\it old\/} value\cr |
2333 | 552 \endsec |
553 | |
554 \sec Comparison and Boolean Operators; | |
555 \omit \vbox{\rm\vskip0.75ex | |
556 These operators work on an element-by-element basis. Both arguments | |
557 are always evaluated.\vskip0.75ex}\span\cr | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
558 < <= == >= >&relational operators\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
559 != \char'176 =¬ equal to\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
560 \& &logical AND\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
561 | &logical OR\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
562 ! \char'176 &logical NOT\cr |
2333 | 563 \endsec |
564 | |
565 \sec Short-circuit Boolean Operators; | |
566 \omit \vbox{\rm\vskip0.75ex | |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
567 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
|
568 necessary, stopping once overall truth value can be determined. |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
569 Non-scalar operands are converted to scalars with |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
570 {\tt all}.\vskip0.75ex}\span\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
571 {\it x} \&\& {\it y}&logical AND\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
572 {\it x} || {\it y}&logical OR\cr |
2333 | 573 \endsec |
574 | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
575 \vfill\eject |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
576 |
2333 | 577 \sec Operator Precedence; |
578 \omit \vbox{\rm\vskip0.5ex | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
579 Table of Octave operators, in order of {\tt increasing} |
2333 | 580 precedence.\vskip0.75ex}\span\cr |
581 ;\ \ ,&statement separators\cr | |
582 =&assignment, groups left to right\cr | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
583 += -= *= /= etc &in-place operators\cr |
2333 | 584 ||\ \ \&\&&logical ``or'' and ``and''\cr |
585 |\ \ \&&element-wise ``or'' and ``and''\cr | |
586 < <= == >= > !=&relational operators\cr | |
587 :&colon\cr | |
588 +\ \ -&addition and subtraction\cr | |
589 * / \char'134\ \ .*\ \ ./\ \ .\char'134&multiplication and division\cr | |
590 '\ \ .'&transpose\cr | |
591 +\ \ -\ \ ++\ \ --\ \ !&unary minus, increment, logical ``not''\cr | |
592 \char'136\ \ .\char'136&exponentiation\cr | |
593 \endsec | |
594 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
595 \sec General programming; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
596 \omit \vbox{\rm\vskip0.5ex |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
597 endfor, endwhile, endif etc can all be replaced by end. |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
598 \vskip0.75ex}\span\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
599 for x = 1:10 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
600 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
601 endfor & for loop\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
602 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
603 while (x <= 10) |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
604 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
605 endwhile & while loop\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
606 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
607 do |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
608 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
609 until (x > 10) & do-until loop\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
610 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
611 if (x < 5) |
2333 | 612 |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
613 elseif (x < 6) |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
614 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
615 else |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
616 |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
617 endif & if-then-else\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
618 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
619 switch (tf) |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
620 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
621 case "true" |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
622 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
623 case "false" |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
624 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
625 otherwise |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
626 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
627 endswitch & switch-case\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
628 |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
629 break & exit innermost loop\cr |
7040 | 630 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
631 continue & go to start of innermost loop\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
632 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
633 return & jump back to calling location\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
634 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
635 try |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
636 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
637 catch & cleanup only on exception\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
638 |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
639 unwind\char'137 protect |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
640 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
641 unwind\char'137 protect\char'137 cleanup & cleanup always \cr |
7040 | 642 \endsec |
643 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
644 \widesec Functions; |
2333 | 645 function \opt{{\it ret-list}} {\it function-name} |
646 \opt{\hskip0.2em({\it arg-list})\hskip0.2em}\cr | |
647 \quad{\it function-body}\cr | |
648 endfunction\cr\cr | |
649 {\rm {\it ret-list\/} may be a single identifier or a comma-separated | |
650 list of identifiers delimited by square-brackets.\vskip0.75ex}\cr | |
651 {\rm {\it arg-list\/} is a comma-separated list of identifiers and may | |
652 be empty.}\cr | |
653 \endsec | |
654 | |
7040 | 655 \sec Function Handles; |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
656 @{\it{func}}& define a function handle to {\it func}\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
657 @({\it var1}, ...) {\it expr}&define an anonymous function\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
658 str2func func2str&convert function to/from string\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
659 functions ({\it handle})&Return information about a function handle\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
660 {\it handle} ({\it arg1}, ...)&Evaluate a function handle\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
661 feval &Evaluate a function handle or string\cr |
7040 | 662 \omit\vbox{\rm\vskip0.25ex |
663 Anonymous function handles take a copy of the variables in the | |
664 current workspace.\vskip0.75ex}\span\cr | |
665 \endsec | |
666 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
667 \sec Global and Persistent Variables; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
668 global {\it var1} = ...&global variables\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
669 persistent {\it var1} = ...&persistent / static variables\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
670 \omit\hfill\vbox{\rm\vskip0.25ex |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
671 Global variables may be accessed inside the body of a function |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
672 without having to be passed in the function parameter list provided |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
673 they are declared global when used.}\span\cr |
7040 | 674 \endsec |
675 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
676 \sec Common Functions; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
677 disp&display value of variable\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
678 printf&formatted output to {\tt stdout}\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
679 input, scanf&input from {\tt stdin}\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
680 who, whos&list current variables\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
681 clear {\it pattern}&clear variables matching pattern\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
682 exist&check existence of variable or function\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
683 find&return indices of nonzero elements\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
684 sort&return a sorted array\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
685 unique&discard duplicate elements\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
686 sortrows&sort whole rows in numerical or lexicographic order\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
687 sum prod&sum or product\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
688 mod rem&remainder functions\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
689 min max range mean median std&basic statistics\cr |
2333 | 690 \endsec |
691 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
692 \sec Error Handling; |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
693 eval ({\it str})&evaluate {\it str} as a command\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
694 system ({\it cmd})&execute arbitrary shell command string\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
695 error ({\it message})&print message and return to top level\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
696 warning ({\it message})&print a warning message\cr |
2333 | 697 \endsec |
698 | |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
699 \sec File I/O, Loading, Saving; |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
700 save load &save or load variables to or from file\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
701 save -binary &save variables in binary format (faster)\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
702 dlmread dlmwrite&read and write delimited data\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
703 csvread csvwrite&read and write CSV files\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
704 xlsread xlswrite&read and write XLS spreadsheets\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
705 |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
706 fopen fclose & open and close file\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
707 fprintf fscanf textscan&formatted file I/O\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
708 fflush&flush pending output\cr |
2333 | 709 \endsec |
710 | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
711 \sec Math Functions; |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
712 \omit \vbox{\rm\vskip0.5ex |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
713 Run {\tt doc <function>} to find related functions. |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
714 \vskip0.75ex}\span\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
715 cov corrcoef&covariance, correlation coefficient\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
716 tan tanh atan2&trig and hyperbolic functions\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
717 cross curl del2&vector algebra functions\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
718 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
719 det inv& determinant matrix inverse\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
720 eig &eigenvalues and eigenvectors\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
721 norm &vector norm, matrix norm\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
722 rank &matrix rank\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
723 qr &QR factorization\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
724 chol &Cholesky factorization\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
725 svd &singular value decomposition\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
726 &\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
727 fsolve&solve nonlinear algebraic equations\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
728 lsode&integrate nonlinear ODEs\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
729 dassl&integrate nonlinear DAEs\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
730 quad&integrate nonlinear functions\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
731 &\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
732 union&set union\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
733 intersection&set intersection\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
734 setdiff&set difference\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
735 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
736 roots &polynomial roots\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
737 poly &matrix characteristic polynomial\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
738 polyder polyint&polynomial derivative or integral\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
739 polyfit polyval&polynomial fitting and evaluation\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
740 residue &partial fraction expansion\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
741 legendre bessel airy&special function\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
742 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
743 conv conv2& convolution, polynomial multiplication\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
744 deconv& deconvolution, polynomial division\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
745 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
746 fft fft2 ifft({\it a})&FFT and inverse FFT\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
747 freqz &FIR filter frequency response\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
748 filter &filter by transfer function\cr |
2333 | 749 \endsec |
750 | |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
751 \sec Plotting And Graphics; |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
752 plot plot3 &2D / 3D plot with linear axes\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
753 line &2D or 3D line\cr |
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
754 patch fill&2D patch, optionally colored\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
755 semilogx semilogy loglog&2D plot with one or both axes on a log scale\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
756 bar hist&bar chart, histogram\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
757 stairs stem&stairsteps and stem graphs\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
758 contour &contour plot\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
759 mesh trimesh surf &plot 3D surfaces\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
760 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
761 figure&new figure\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
762 hold on&add to existing figure\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
763 title &set plot title\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
764 axis &set axis range and aspect\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
765 xlabel ylabel zlabel &set axis labels\cr |
31264
af3752d9a59f
doc: Update refcard.tex content from Octave 3 to Octave 8
Arun Giridhar <arungiridhar@gmail.com>
parents:
30564
diff
changeset
|
766 text &add text to a plot\cr |
31272
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
767 grid legend &draw grid or legend\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
768 &\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
769 image imagesc spy&display matrix as image\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
770 imwrite saveas print&save figure or image\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
771 imread&load an image\cr |
3e4b9ecc031c
doc: More changes to refcard.tex
Arun Giridhar <arungiridhar@gmail.com>
parents:
31264
diff
changeset
|
772 colormap &get or set colormap\cr |
2333 | 773 \endsec |
774 | |
775 \vskip 0pt plus 2fill | |
776 \hrule width \hsize | |
777 \par\vskip10pt | |
778 {\smrm\parskip=6pt | |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
779 Edition \refcardedition\ for Octave Version \octaveversion. |
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
780 Copyright 1996-2022 The Octave Project Developers. The authors assume |
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
781 no responsibility for any errors on this card. |
2333 | 782 |
783 This card may be freely distributed under the terms of the GNU | |
784 General Public License. | |
785 | |
786 \TeX{} Macros for this card by Roland Pesch (pesch@cygnus.com), | |
787 originally for the GDB reference card | |
788 | |
789 Octave itself is free software; you are welcome to distribute copies of | |
790 it under the terms of the GNU General Public License. There is | |
791 absolutely no warranty for Octave. | |
792 } | |
793 | |
794 \end | |
795 | |
796 % For AUCTeX: | |
797 % | |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
798 % Local Variables: |
2333 | 799 % mode: tex |
800 % TeX-master: t | |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
801 % End: |