Mercurial > octave-libgccjit
comparison doc/interpreter/intro.txi @ 9033:c7d60ac7a3e6
Documentation cleanup of preface and intro
Spellcheck files
A few rewordings for greater clarity
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Fri, 20 Mar 2009 17:01:49 -0700 |
parents | eb63fbe60fab |
children | 0b08eaf77dd6 |
comparison
equal
deleted
inserted
replaced
9032:349616d9c38e | 9033:c7d60ac7a3e6 |
---|---|
34 Public License as published by the Free Software Foundation. The GPL is | 34 Public License as published by the Free Software Foundation. The GPL is |
35 included in this manual in @ref{Copying}. | 35 included in this manual in @ref{Copying}. |
36 | 36 |
37 This document corresponds to Octave version @value{VERSION}. | 37 This document corresponds to Octave version @value{VERSION}. |
38 | 38 |
39 @c FIXME -- add explanation about how and why Octave was written. | |
40 @c | |
41 @c FIXME -- add a sentence or two explaining that we could | |
42 @c always use more funding. | |
43 | |
44 @menu | 39 @menu |
45 * Running Octave:: | 40 * Running Octave:: |
46 * Simple Examples:: | 41 * Simple Examples:: |
47 * Conventions:: | 42 * Conventions:: |
48 @end menu | 43 @end menu |
54 @samp{octave}. Octave displays an initial message and then a prompt | 49 @samp{octave}. Octave displays an initial message and then a prompt |
55 indicating it is ready to accept input. You can begin typing Octave | 50 indicating it is ready to accept input. You can begin typing Octave |
56 commands immediately afterward. | 51 commands immediately afterward. |
57 | 52 |
58 If you get into trouble, you can usually interrupt Octave by typing | 53 If you get into trouble, you can usually interrupt Octave by typing |
59 @kbd{Control-C} (usually written @kbd{C-c} for short). @kbd{C-c} gets | 54 @kbd{Control-C} (written @kbd{C-c} for short). @kbd{C-c} gets |
60 its name from the fact that you type it by holding down @key{CTRL} and | 55 its name from the fact that you type it by holding down @key{CTRL} and |
61 then pressing @key{c}. Doing this will normally return you to Octave's | 56 then pressing @key{c}. Doing this will normally return you to Octave's |
62 prompt. | 57 prompt. |
63 | 58 |
64 @cindex exiting octave | 59 @cindex exiting octave |
80 are lines you type, ending each with a carriage return. Octave will | 75 are lines you type, ending each with a carriage return. Octave will |
81 respond with an answer, or by displaying a graph. | 76 respond with an answer, or by displaying a graph. |
82 | 77 |
83 @subsection Creating a Matrix | 78 @subsection Creating a Matrix |
84 | 79 |
85 To create a new matrix and store it in a variable so that it you can | 80 To create a new matrix and store it in a variable so that you can |
86 refer to it later, type the command | 81 refer to it later, type the command |
87 | 82 |
88 @example | 83 @example |
89 octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ] | 84 octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ] |
90 @end example | 85 @end example |
91 | 86 |
92 @noindent | 87 @noindent |
93 Octave will respond by printing the matrix in neatly aligned columns. | 88 Octave will respond by printing the matrix in neatly aligned columns. |
94 Ending a command with a semicolon tells Octave to not print the result | 89 Ending a command with a semicolon tells Octave not to print the result |
95 of a command. For example | 90 of the command. For example |
96 | 91 |
97 @example | 92 @example |
98 octave:2> B = rand (3, 2); | 93 octave:2> B = rand (3, 2); |
99 @end example | 94 @end example |
100 | 95 |
101 @noindent | 96 @noindent |
102 will create a 3 row, 2 column matrix with each element set to a random | 97 will create a 3 row, 2 column matrix with each element set to a random |
103 value between zero and one. | 98 value between zero and one. |
104 | 99 |
105 To display the value of any variable, simply type the name of the | 100 To display the value of a variable, simply type the name of the |
106 variable. For example, to display the value stored in the matrix | 101 variable at the prompt. For example, to display the value stored in the |
107 @code{B}, type the command | 102 matrix @code{B}, type the command |
108 | 103 |
109 @example | 104 @example |
110 octave:3> B | 105 octave:3> B |
111 @end example | 106 @end example |
112 | 107 |
207 @ifnottex | 202 @ifnottex |
208 @code{f(x,t)}. | 203 @code{f(x,t)}. |
209 @end ifnottex | 204 @end ifnottex |
210 This is straightforward, and may be accomplished by entering the | 205 This is straightforward, and may be accomplished by entering the |
211 function body directly on the command line. For example, the following | 206 function body directly on the command line. For example, the following |
212 commands define the right hand side function for an interesting pair of | 207 commands define the right-hand side function for an interesting pair of |
213 nonlinear differential equations. Note that while you are entering a | 208 nonlinear differential equations. Note that while you are entering a |
214 function, Octave responds with a different prompt, to indicate that it | 209 function, Octave responds with a different prompt, to indicate that it |
215 is waiting for you to complete your input. | 210 is waiting for you to complete your input. |
216 | 211 |
217 @example | 212 @example |
295 @subsection Editing What You Have Typed | 290 @subsection Editing What You Have Typed |
296 | 291 |
297 At the Octave prompt, you can recall, edit, and reissue previous | 292 At the Octave prompt, you can recall, edit, and reissue previous |
298 commands using Emacs- or vi-style editing commands. The default | 293 commands using Emacs- or vi-style editing commands. The default |
299 keybindings use Emacs-style commands. For example, to recall the | 294 keybindings use Emacs-style commands. For example, to recall the |
300 previous command, press @kbd{Control-p} (usually written @kbd{C-p} for | 295 previous command, press @kbd{Control-p} (written @kbd{C-p} for |
301 short). Doing this will normally bring back the previous line of input. | 296 short). Doing this will normally bring back the previous line of input. |
302 @kbd{C-n} will bring up the next line of input, @kbd{C-b} will move | 297 @kbd{C-n} will bring up the next line of input, @kbd{C-b} will move |
303 the cursor backward on the line, @kbd{C-f} will move the cursor forward | 298 the cursor backward on the line, @kbd{C-f} will move the cursor forward |
304 on the line, etc. | 299 on the line, etc. |
305 | 300 |
306 A complete description of the command line editing capability is given | 301 A complete description of the command line editing capability is given |
315 | 310 |
316 In order to get good help you first need to know the name of the command | 311 In order to get good help you first need to know the name of the command |
317 that you want to use. This name of the function may not always be | 312 that you want to use. This name of the function may not always be |
318 obvious, but a good place to start is to just type @code{help}. | 313 obvious, but a good place to start is to just type @code{help}. |
319 This will show you all the operators, reserved words, functions, | 314 This will show you all the operators, reserved words, functions, |
320 built-in variables, and function files. An alternative is to search the | 315 built-in variables, and function files. An alternative is to search the |
321 documentation using the @code{lookfor} function. This function is | 316 documentation using the @code{lookfor} function. This function is |
322 described in @ref{Getting Help}. | 317 described in @ref{Getting Help}. |
323 | 318 |
324 Once you know the name of the function you wish to use, you can get more | 319 Once you know the name of the function you wish to use, you can get more |
325 help on the function by simply including the name as an argument to help. | 320 help on the function by simply including the name as an argument to help. |
326 For example, | 321 For example, |
517 @end group | 512 @end group |
518 @end example | 513 @end example |
519 @end deftypefn | 514 @end deftypefn |
520 | 515 |
521 Any parameter whose name contains the name of a type (e.g., | 516 Any parameter whose name contains the name of a type (e.g., |
522 @var{integer}, @var{integer1} or @var{matrix}) is expected to be of that | 517 @var{integer} or @var{matrix}) is expected to be of that |
523 type. Parameters named @var{object} may be of any type. Parameters | 518 type. Parameters named @var{object} may be of any type. Parameters |
524 with other sorts of names (e.g., @var{new_file}) are discussed | 519 with other sorts of names (e.g., @var{new_file}) are discussed |
525 specifically in the description of the function. In some sections, | 520 specifically in the description of the function. In some sections, |
526 features common to parameters of several functions are described at the | 521 features common to parameters of several functions are described at the |
527 beginning. | 522 beginning. |
557 @node A Sample Command Description | 552 @node A Sample Command Description |
558 @subsubsection A Sample Command Description | 553 @subsubsection A Sample Command Description |
559 @cindex command descriptions | 554 @cindex command descriptions |
560 | 555 |
561 Command descriptions have a format similar to function descriptions, | 556 Command descriptions have a format similar to function descriptions, |
562 except that the word `Function' is replaced by `Command. Commands are | 557 except that the word `Function' is replaced by `Command'. Commands are |
563 functions that may be called without surrounding their arguments in | 558 functions that may be called without surrounding their arguments in |
564 parentheses. For example, here is the description for Octave's | 559 parentheses. For example, here is the description for Octave's |
565 @code{cd} command: | 560 @code{cd} command: |
566 | 561 |
567 @deffn {Command} cd dir | 562 @deffn {Command} cd dir |