[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wikibook on octave
From: |
John W. Eaton |
Subject: |
Re: Wikibook on octave |
Date: |
Tue, 30 Jan 2007 22:43:46 -0500 |
On 30-Jan-2007, Nicolas Pettiaux wrote:
| I did and created the 3 pages below that need edition and complements.
|
| http://en.wikibooks.org/wiki/MATLAB_Programming/Comparing_Octave
|
| http://en.wikibooks.org/wiki/MATLAB_Programming/GNU_Octave
|
| A short presentation of Octave and its history.
|
|
http://en.wikibooks.org/wiki/MATLAB_Programming/Differences_between_Octave_and_MATLAB
| PS I copied parts from the octave wiki but I could not view its source
| as I do not find / have its password. Also, can I suggest that the
| Octave wiki be moved to a mediawiki instead of the current wiki that
| is much less pleasant to edit ?
There are a number of errors on these pages. That is of course not
your fault since these seem to be copied from the Octave wiki which
has also had the errors for a long time, I think. I guess it is time
for someone to fix the bugs.
* The section on variable length argument/return lists should be
deleted, as that form is now deprecated and replaced by
varargin/varargout, which works the same as in Matlab.
* The discussion of the difference between && and & (| and ||) is
irrelevant now because Matlab does the same. However, it might be
mentioned that Matlab still does short-circuiting for & and |, but
ONLY inside the condition of an IF or WHILE statement, and ONLY if
the first operand is a scalar. But this can bite you in some
cases (think about operands that have side effects and operands
that are empty matrices) so this "feature" it is not implemented
in Octave. Also, it is surprising if you do something like this:
if (condition | error ('condition is fubar'))
...
end
and find that it suddenly fails to work as you expect when you
decide to write it like this instead:
t = condition | error ('condition is fubar');
if (t)
...
end
* The section on command history is irrelevant now because Matlab
has command history (it has for a long time, but only "recently"
has it been saved across sessions).
* The section on command name and variable completion is now
irrelevant because Matlab can now do these too (and actually, I
think better than Octave, so if anyone reading this would like a
project, there's a nice one).
* The item
['abc ';'abc'] is allowed in Octave in --traditional mode;
Matlab rerturns: ?? Error using ==> vertcat
is not correct. This is allowed in Octave and Matlab. Maybe the
person who wrote it meant to use something like
['character'; 'strings'; 'with'; 'different'; 'lengths']
as an example?
* The item
a = ['\n'] ; b=find('abc' == '\n')
Matlab 6.5 : ??? Error using ==> eq Array dimensions must
match for binary array op.
Octave 2.1.71 : b=[]
could maybe use more explanation. It will fail in Octave 2.9.9,
which makes the single quoted character string '\n' two
characters (backslash and 'n'), but the double quoted character
string "\n" is a single character (linefeed). In Octave 2.1.x,
both single and double quoted strings were identical.
Also, why would anyone write a = ['\n'] instead of just a = '\n'?
* I wouldn't say it's a kludge that fprintf in Matlab is written to
detect that its first argument is a format string and then act as
the C-library printf function does.
* The following items are all incorrect:
For a logical-and, Octave can use `&' or `&&'; Matlab requires `&'.
For a logical-or, Octave can use `|' or `||'; Matlab requires
`|'. (note: Octave's '||' and '&&' return a scalar, '|' and
'&' return matrices)
For string delimiters, Octave can use ` or "; Matlab requires '.
* The item
For gallery, compan, and hadamard install
http://www.ma.man.ac.uk/~higham/testmat.html
is out of date for 2.9.x which has compan and hadamard
functions.
* The following item is bad advice, and will fail anyway as the
function is __gnuplot_set__, not __gnuplot_set.
For datetick use gnuplot commands:
__gnuplot_set xdata time
__gnuplot_set timefmt "%d/%m"
__gnuplot_set format x "%b %d"
jwe
- Re: Evaluating a string in octave, (continued)
- Re: Evaluating a string in octave, antonio palestrini, 2007/01/29
- Re: Evaluating a string in octave, Muthiah Annamalai, 2007/01/29
- Re: Evaluating a string in octave, antonio palestrini, 2007/01/29
- Re: Evaluating a string in octave, antonio palestrini, 2007/01/29
- Re: Evaluating a string in octave, David Bateman, 2007/01/29
- Re: Evaluating a string in octave, Doug Stewart, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/30
Re: Wikibook on octave, Alexander Barth, 2007/01/29
- Re: Wikibook on octave, David Bateman, 2007/01/29
- Re: Wikibook on octave, John W. Eaton, 2007/01/29
- Re: Wikibook on octave, David Bateman, 2007/01/29
- Re: Wikibook on octave, Steve C. Thompson, 2007/01/29
- Re: Wikibook on octave, John W. Eaton, 2007/01/29
- Re: Wikibook on octave, Bill Denney, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/29
Re: Wikibook on octave, Nicolas Pettiaux, 2007/01/29