[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isa strangeness
From: |
Martin Helm |
Subject: |
Re: isa strangeness |
Date: |
Mon, 16 Aug 2010 04:31:54 +0200 |
User-agent: |
KMail/1.13.5 (Linux/2.6.31.12-0.2-desktop; KDE/4.4.4; x86_64; ; ) |
Am Montag, 16. August 2010, 04:18:33 schrieb Richard E. Harke:
> I installed octave last night and have been reading the manual
> trying things. (Debian lenny system, installed from debian archive)
> I tried:
> 10> class(10)
> ans = double
>
> Seems good. Then I tried:
> 11> isa(10, double)
>
> Invalid call to double. ......
>
> which seems like a bug
>
> Even more curious:
> 12> isa(10, double(10))
> ans = 0
>
> which seems to say that 10 does not belong to the class it belongs to.
>
> 13> isa(10, class(10))
> ans = 1
> is correct but hardly seems useful.
>
> This is not an auspicious start.
>
> Richard
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
The help string of isa is not really good here.
Use
isa(10, "double") or isa(10, 'double')
class in isa is expected to be a string here which contains the class name.
The reason is the syntax
isa(10, double)
will treat double as a function call without arguments, which is a syntax
error.
- mh
- isa strangeness, Richard E. Harke, 2010/08/15
- Re: isa strangeness,
Martin Helm <=
- Re: isa strangeness, Jaroslav Hajek, 2010/08/16
- Re: isa strangeness, Martin Helm, 2010/08/16
- Re: isa strangeness, Jaroslav Hajek, 2010/08/16
- Re: isa strangeness, Martin Helm, 2010/08/16
- Re: isa strangeness, Michael Goffioul, 2010/08/16
- Re: isa strangeness, Martin Helm, 2010/08/16
- Re: isa strangeness, Michael Goffioul, 2010/08/16
- Re: isa strangeness, Martin Helm, 2010/08/16
- Re: isa strangeness, Richard E. Harke, 2010/08/16
- Re: isa strangeness, Martin Helm, 2010/08/16