[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to determine if you are in octave or matlab
From: |
David Bateman |
Subject: |
Re: How to determine if you are in octave or matlab |
Date: |
Wed, 02 May 2007 10:45:30 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Eric Chassande-Mottin wrote:
>> function in = inoctave ()
>> persistent inout = exist("OCTAVE_VERSION","builtin") != 0;
>> in = inout;
>> endfunction
>
> to be compatible with Matlab (I tried with 7.2) as well, this has to
> be modified into
>
> function in = isoctave ()
> persistent inout;
>
> if isempty(inout),
> inout = exist('OCTAVE_VERSION','builtin') ~= 0;
> end;
> in = inout;
>
> return;
Damn, yes.. The assignment in the persistent statement is an octave only
thing.. Missed that.. The form you have is the best way..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary