From help-octave-request at bevo dot che dot wisc dot edu Fri Jan 8 04:17:18 1999 Subject: Re: Existence of a variable From: Kai Mueller To: Daniel Tourde Cc: help-octave at bevo dot che dot wisc dot edu Date: Fri, 8 Jan 1999 11:16:12 +0100 On Fri, Jan 08, 1999 at 10:54:43AM +0100, Daniel Tourde wrote: [snip] > 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 -- Kai P. Mueller Control Department (Regelungstechnik) | Phone [+49] (531) 391-3835 Technical University Braunschweig | Fax [+49] (531) 391-5194 D-38092 Braunschweig | Email mueller at ifr dot ing dot tu-bs dot de