help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improving 'Help'-File (Tutorial)


From: Uwe Dippel
Subject: Improving 'Help'-File (Tutorial)
Date: Sat, 10 Oct 2009 23:44:51 +0800
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Over the last days I have tried to get a grip on Octave, in vain. What I did was going through the help; and what I found was an inconsistency. I fully agree, that those familiar with octave will not encounter this problem; but for newbies it would be a great help, could we newbies distinguish clearly what we can *type* and what is *explanation*.
Already here at the very start of the 'Help':

1.2.1 Creating a Matrix

To create a new matrix and store it in a variable so that it you can refer to it later, type the command

octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ] Octave will respond by printing the matrix in neatly aligned columns. Ending a command with a semicolon tells Octave to not print the result of a command. For example

octave:2> B = rand (3, 2); will create a 3 row, 2 column matrix with each element set to a random value between zero and one.

To display the value of any variable, simply type the name of the variable. For example, to display the value stored in the matrix B, type the command

octave:3> B
1.2.2 Matrix Arithmetic

Octave has a convenient operator notation for performing matrix arithmetic. For example, to multiply the matrix a by a scalar value, type the command

octave:4> 2 * A
To multiply the two matrices a and b, type the command

octave:5> A * B
and to form the matrix product transpose (A) * A, type the command

octave:6> A' * A
1.2.3 Solving Linear Equations

To solve the set of linear equations Ax = b, use the left division operator, ‘\’:

octave:7> A \ b This is conceptually equivalent to inv (a) * b, but avoids computing the inverse of a matrix directly.

If the coefficient matrix is [...]


Of course, the latter fails with "error: `b' undefined near line 7 column 5"

And this isn't the only one. Though, 1-6 follow each other sequentially, and logically. As someone who has gone through 'R' tutorials, I found it very helpful, that all lines starting with '>', and typed sequentially, will result in a given output. While lines explaining syntax are written with the prompt at the beginning. And if the input to a prompt is yet to be defined by the user, the user-part will be written in italics. I really wished something like this was to be found in the examples of octave as well. It simply is a great encouragement, if a sequence of prompts, entered one after the other, actually resulted in some output, and not in a syntax error. Similar things happen on the subsequent pages; up to and including the examples for plots.

Uwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]