Using the Editor and Debugger with Classes

April 21st, 2010 No Comments   Posted in Documents

Referring to Class Files

Define classes in M-files just like scripts and functions. To use the editor or debugger with a class file, use the full class name. For example, suppose the file for a class, myclass.m is in the following location: Read More

Understanding Code Analyzer Warnings

April 21st, 2010 No Comments   Posted in Documents

Syntax Warnings and Property Names

The MATLAB code analyzer helps you optimize your code and avoid syntax errors while you write code. It is useful to understand some of the rules that the Code Analyzer applies in its analysis of class definition code. This understanding helps you avoid situations in which MATLAB allows code that is undesirable. Read More

Modifying and Reloading Classes

April 20th, 2010 No Comments   Posted in Documents

Ensuring MATLAB Uses Your Changes

There is only one class definition for a given class in MATLAB at any given time. When you create an instance of a class, MATLAB loads the class definition. So as long as instances of that class exist, MATLAB does not reload the class definition. Read More

Example of Class Definition Syntax

April 20th, 2010 No Comments   Posted in Examples

Example of Class Definition Syntax

The following code shows the syntax of a typical class definition. This example is not a functioning class because it references functions that it does not implement. The purpose of this section is to illustrate various syntactic constructions. Read More

Calling Superclass Methods on Subclass Objects

April 18th, 2010 No Comments   Posted in Documents

Calling a Superclass Constructor

If you create a subclass object, MATLAB calls the superclass constructor to initialize the superclass part of the subclass object. By default, MATLAB calls the superclass constructor without arguments. If you want the superclass constructor called with specific arguments, explicitly call the superclass constructor from the subclass constructor. The call to the superclass constructor must come before any other references to the object. Read More

Syntax Reference & Specifying Attributes

April 18th, 2010 No Comments   Posted in Documents

Attribute Syntax

For a quick reference to all attributes, see Attribute Tables. Read More

Matlab Events and Listeners

April 18th, 2010 No Comments   Posted in Documents

Specifying Events

To define an event, you declare a name for the event in the events block. Then one of the class methods triggers the event using the notify method, which is method inherited from the handle class. Only classes derived from the handle class can define events. Read More