23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

class<br />

2-262<br />

obj = class(s,'class_name',parent1,parent2,...) creates an object of<br />

<strong>MATLAB</strong> class 'class_name' that inherits the methods and fields of the<br />

parent objects parent1, parent2, and so on. Structure s is used as a template<br />

for the object.<br />

obj = class(struct([]),'class_name',parent1,parent2,...) creates an<br />

object of <strong>MATLAB</strong> class 'class_name' that inherits the methods and fields of<br />

the parent objects parent1, parent2, and so on. Specifying the empty<br />

structure, struct([]), as the first argument ensures that the object created<br />

contains no fields other than those that are inherited from the parent objects.<br />

Examples To return in nameStr the name of the class of Java object j<br />

nameStr = class(j)<br />

To create a user-defined <strong>MATLAB</strong> object of class polynom<br />

p = class(p,'polynom')<br />

See Also inferiorto, isa, superiorto<br />

The “<strong>MATLAB</strong> Classes and Objects” and the “Calling Java from <strong>MATLAB</strong>”<br />

chapters in Programming and Data Types.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!