Programming and Data Types | ![]() ![]() |
Creating Objects
You create an object by calling the class constructor and passing it the appropriate input arguments. In MATLAB, constructors have the same name as the class name. For example, the statement,
p = polynom([1 0
-2
-5]);
creates an object named p
belonging to the class polynom
. Once you have created a polynom object, you can operate on the object using methods that are defined for the polynom
class. See Example - A Polynomial Class for a description of the polynom
class.
![]() | MATLAB Data Class Hierarchy | Invoking Methods on Objects | ![]() |