[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Octave class versus Matlab class
From: |
Steve C. Thompson |
Subject: |
Octave class versus Matlab class |
Date: |
Wed, 29 Nov 2006 12:41:40 -0800 |
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
- Octave class versus Matlab class,
Steve C. Thompson <=