help-octave
[Top][All Lists]
Advanced

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

Re: Octave class versus Matlab class


From: Steve C. Thompson
Subject: Re: Octave class versus Matlab class
Date: Wed, 29 Nov 2006 17:12:31 -0800

Dear Group,

To possibly answer my own question, I've found Paul Kienzle's
<http://users.powernet.co.uk/kienzle/octave/matcompat/HTML/cat-types.html>.
The ``Classes and objects'' section is red, meaning: ``Function
doesn't exist, and no work-around''.

Does anyone know if there are plans for classes/objects support
in future GNU Octave releases?  Again, I'm running 2.1.73.

In the mean time, I'm trying to appreciate the advantage of using
classes and objects for the code that I've been given and have to
work with.  I'm wondering if I should port it so it runs in
Octave without the use of classes/objects.  Does anyone have an
opinion on the advantages of classes/objects.  Since it is not
supported in Octave, does that mean there is weak user demand, or
are their other reasons?

Steve



On Wed, 2006-11-29 at 12:41 -0800, Steve C. Thompson wrote:
> Dear Octave Help,
> 
> I'm trying to work with Matlab code that uses `class'.
> This is new territory for me, so my problem may be a
> lack of understanding `class'.  However, it might be
> due to compatibility issues.
> 
> I'm confronted with something like:
> 
>   obj = class(s, 'class_name')
> 
> According to
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/class.html
> this command:
> 
>   creates an object of MATLAB class 'class_name' using
>   structure s as a template. This syntax is valid only in a
>   function named class_name.m in a directory named
>   @class_name (where 'class_name' is the same as the string
>   passed in to class).
> 
> It appears that GNU Octave 
> 
>   [$ octave --version
>    GNU Octave, version 2.1.73 (i486-pc-linux-gnu).
>    Copyright (C) 2006 John W. Eaton.]
> 
> does not support this.  I do have `class', but
> 
>   octave:1> help class
>   class is a built-in function
> 
>     -- Built-in Function:  class (EXPR)
>         Return the class of the expression EXPR, as a
>         string.
> 
> which is consistent with
> http://octave.sourceforge.net/index/f/class.html.  So
> it looks like Octave's `class' implements Matlab's
> 
>   str = class(object)
> 
> [http://www.mathworks.com/access/helpdesk/help/techdoc/ref/class.html],
> and not Matlab's other `class' conventions? If this is
> the case, does anyone know of a work around?
> 
> Regards,
> Steve Thompson



reply via email to

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