[Top][All Lists]

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

Re: Existence of a variable

From: Kai Mueller
Subject: Re: Existence of a variable
Date: Fri, 8 Jan 1999 11:16:12 +0100

On Fri, Jan 08, 1999 at 10:54:43AM +0100, Daniel Tourde wrote:
> I hoped that exist(b) will give me 0 or 1 as explained in the help.
> Unfortunately, when I type exist(b), Octave complains and tell me that b
> does not exist, which is what I want to test, the existence of the
> variable b. I do not obtain the 0 value whuch would have been useful in
> a test like this
> if (exist(b))
>    if (b) 
> ...
> Does anyone has an idea about how I could solve this problem ?

if (exist("b")) ...  is the correct syntax. Octave expects a
string as argument to exist. Didn't Octave tell that it
expects a string instead of a scalar?


 Kai P. Mueller
 Control Department (Regelungstechnik) | Phone [+49] (531) 391-3835
 Technical University Braunschweig     | Fax   [+49] (531) 391-5194
 D-38092 Braunschweig                  | Email address@hidden

reply via email to

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