[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matlab references in docs; distinguishing between ML and Octave
From: |
Philip Nienhuis |
Subject: |
Re: Matlab references in docs; distinguishing between ML and Octave |
Date: |
Sun, 24 Mar 2013 12:46:35 -0700 (PDT) |
bpabbott wrote
> On Mar 24, 2013, at 2:54 PM, Philip Nienhuis wrote:
>
>> While perusing the Octave documentation about Java I noted several
>> references
>> to Matlab; one in particular about "how to distinguish between Octave and
>> Matlab".
>>
>> 1. Is there a policy about mentioning ML in the Octave docs?
>> IMO it should be minimized to "only when unavoidable"; but because of
>> Octave's aim for ML compatibility, references to Matlab are all over the
>> place.
>>
>> 2. What would be a good place in the doc for a description of how to
>> distinguish between ML and Octave? The Java section is too narrow-scoped.
>> Dropping this info entirely or referring to the wiki seems a bit
>> inappropriate to me. I'd find it a bit double-hearted to aim to be
>> ML-compatible while mentioning nowhere how to differentiate between the
>> two
>> in scripts and m-file functions.
>>
>> 3. A way to distinguish Octave and ML, that works in both, could be to
>> use
>> the "computer" function; I saw that ML and Octave return different
>> answers
>> for the first output arg ('win32' and "i686-pc-mingw32", resp.; when
>> called
>> with 'arch': 'win32' and "mingw32-i686", resp.).
>> I don't know what answers Matlab and Octave give on OSX, nor what ML
>> would
>> answer on Linux.
>>
>> Philip
>
> I think the easiest way to distinguish is to use the "ver" command.
>
> "x = ver ()" returns a structure array with fields "Name", "Version",
> "Release", and "Date". For Octave x(1).Name equals "Octave", and for
> Matlab x(1).Name equals "Matlab".
Good hint.
In Octave ver() gives a fairly big struct array, depending on installed
packages. (In ML having many toolboxes is at least financially discouraged).
The call to ver() does take a bit of time:
Octave (MinGW, MXE cross-compiled, 14 pkgs installed)
======
octave.exe:3> tic; for ii=1:100; x=computer('arch');end; toc
Elapsed time is 0.0312469 seconds.
octave.exe:4> tic; for ii=1:100; x=ver();a=x(1);end; toc
Elapsed time is 6.14003 seconds.
Matlab r2013a prerelease
======
>> tic; for ii=1:100; x=computer('arch');end;toc
Elapsed time is 0.000609 seconds.
>> tic; for ii=1:100; x=ver();a = x(1);end;toc
Elapsed time is 0.386005 seconds.
... So the results should be cached somewhere to avoid long delays when
called repeatedly from different functions/scripts. Preferrably in some
"isoctave"-like function.
Anyway, where in the docs would be an appropriate place for describing a
trick like this?
Philip
--
View this message in context:
http://octave.1599824.n4.nabble.com/Matlab-references-in-docs-distinguishing-between-ML-and-Octave-tp4651172p4651176.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.