[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 10 Mar 2020 13:22:12 +0100 (CET)
first of all: many thanks to all commenters - and you were fully right (and I
was fully wrong :-))
ans = 1
because the value of "A" (which is "B" in this case) is a valid variable name.
So, A=1; isvarname(A) returns isvarname(1) and therefore 0 because "1" cannot
be the name of a variable.
So, I understood it now :-). One thing that I had misunderstood was that I had
had thought isvarname would check if "A" is actually the name of a variable.
However, I understand now this is only a test whether or not it is basically
possible to use it as the name of a variable.
Take care, thank you for a great program
Betreff: Re: Strange?
Von: "Sergei Steshenko via Help-octave" <address@hidden>
An: "address@hidden" <address@hidden>
On 10/03/2020 10:47, Ian McCallion wrote:
> On Tue, 10 Mar 2020 at 08:22, address@hidden
> <address@hidden> wrote:
>> Dear listmembers,
>> I am currently trying to go through the documentation - it's something like
>> 1000 pages, so this takes time :-). I am using octave 5.2.0. When I say
>> A = 5
>>>> isvarname (A)
>> ans = 0
>> shouldn't this be "1" rather than "0"? The manual states "Return true if
>> name is a valid variable name". In my example I consider "A" a valid
>> variable name, isn't it? So, could you shed some light on what I am doing
>> wrong here?
> you need to say:
> Cheers... Ian
Most likely isvarname('A') - IIRC Octave is case-sensitive.