Author Archive
Comparing Handle and Value Classes
Why Select Handle or Value
MATLAB support two kinds of classes — handle classes and value classes. The kind of class you use depends on the desired behavior of the class instances and what features you want to use. Read More
Tags: Arrays of Handle Objects, Behavior of MATLAB Built-In Classes, Classdef, Defining Events and Listeners — Syntax and Techniques, delete, Dynamic Properties — Adding Properties to an Instance, Functions, Graphics, Handle Class Delete Methods, Handle Class Methods, How to Initialize Property Values, Implementing a Set/Get Interface for Properties, matlab, Memory Allocation for Arrays, Passing Objects to Functions, The Handle Superclass, Which Kind of Class to Use
Specifying Class Precedence
InferiorClasses Attribute
You can specify the relative precedence of user-defined classes using the class InferiorClasses attribute. Assign a cell array of class names (represented as meta.class objects) to this attribute to specify classes that are inferior to the class you are defining. For example, the following classdef declares that myClass is dominant over class1 and class2. Read More
Tags: cell, char, Class Precedence and MATLAB Path, Classesdouble, Concatenating Objects of Different Classes, Determining Which Method Is Invoked, function_handle, Inferior, InferiorClasses, int16, int32, int64, int8, logical, matlab, single, struct, uint16, uint32, uint64, uint8, Working with Meta-Classes
Scoping Classes with Packages
Package Folders
Packages are special folders that can contain class folders, function and class definition files, and other packages. Packages define a scope (sometimes called a namespace) for the contents of the package folder. This means function and class names need to be unique only within the package. Using a package provides a means to organize classes and functions and to select names for these components that other packages can reuse. Read More
Matlab Class for Graphing Functions
Display Fully Commented Example Code
The class block is the code that starts with the classdef key word and terminates with the end key word. The following example illustrated a simple class definition that uses: Read More
Matlab Implementing Linked Lists
Displaying Fully Commented Example Code
Open class code in a popup window — Use this link if you want to see the code for this class annotated with links to descriptive sections. Read More
Tags: addNode, Basic Structure of Constructor Methods, class, Classdef, Comparing Handle and Value Classes, Defining the dlnode Class, disp, Displaying Fully Commented Example Code, dlnode, Handle Class Delete Methods, insert node, Inserting Nodes, matlab, matlab example, matlab node, NamedNode, node, Open class code in a popup window, Open class definition file in the MATLAB editor., The Handle Superclass, Why a Handle Class for Doubly Linked Lists?
Matlab Defining Classes — Syntax
classdef Syntax
Class definitions are blocks of code that are delineated by the classdef keyword at the beginning and the end keyword at the end. Files can contain only one classes definition. Read More
Matlab Class Overview
MATLAB User-Defined Classes
A MATLAB class definition is a template whose purpose is to provide a description of all the elements that are common to all instances of the class. Class members are the properties, methods, and events that define the class. Read More
Tags: Attributes, Building on Other Classes, Class Attributes, Class Constructor Methods, classdef Syntax, classes, Comparing Handle and Value Classes, Creating Object Arrays, Event, Event Attributes, matlab, Method Attributes, Object Arrays, Property Attributes, Specifying Attributes, syntax, Working with Meta-Classes