MATLAB Object-Oriented Programming

(Joyce) #1
Property Value Purpose
FofXY function
handle

MATLAB expression (function of two variables).

Lm two-element
vector

Limits over which function is evaluated in both
variables. SetObservable attribute set to true to
enable property event listeners.
Data structure with
x, y, and z
matrices

Data resulting from evaluating the function. Used for
surface graph. Dependent attribute set to true,
which means the get.Data method is called to
determine property value when queried and no data
is stored.

Event When Triggered
UpdateGraph FofXY property set function (set.FofXY) calls the notify method
when a new value is specified for the MATLAB expression on an
object of this class.

Method Purpose
fcneval Class constructor. Inputs are function handle and two-element vector
specifying the limits over which to evaluate the function.
set.FofXY FofXY property set function. Called whenever property value is set,
including during object construction.
set.Lm Lm property set function. Used to test for valid limits.
get.Data Data property get function. This method calculates the values for
the Data property whenever that data is queried (by class members
or externally).
grid A static method (Static attribute set to true) used in the
calculation of the data.

Summary of fcnview Class


Objects of the fcnview class contain fcneval objects as the source of data for the four
surface graphs created in a function view. fcnview creates the listeners and callback
functions that respond to changes in the data contained in fcneval objects. For a listing
of the class definition, see “@fcnview/fcnview.m Class Code” on page 11-65

11 Events — Sending and Responding to Messages

Free download pdf