MATLAB Function Reference
  Go to function:
    Search    Help Desk 
class    See Also

Create object or return class of object

Syntax

Description

str = class(object) returns a string specifying the class of object.

The possible object classes are:

cell

Multidimensional cell array

double

Multidimensional double precision array

sparse

Two-dimensional real (or complex) sparse array

char

Array of alphanumeric characters

struct

Structure

'class_name'

User-defined object class

obj = class(s,'class_name') creates an object of class 'class_name' using structure s as a template. This syntax is only valid in a function named class_name.m in a directory named @class_name (where 'class_name' is the same as the string passed into class).

NOTE
On VMS, the method directory is named #class_name.

obj = class(s,'class_name',parent1,parent2,...) creates an object of class 'class_name' using structure s as a template, and also ensures that the newly created object inherits the methods and fields of the parent objects parent1, parent2, and so on.

See Also

inferiorto  Inferior class relationship

isa         Detect an object of a given class

superiorto  Superior class relationship



[ Previous | Help Desk | Next ]