MATLAB Object-Oriented Programming
fcnview Properties Listeners fcneval object graph Lm property UpdateGraph fcneval Properties Events FofXY Lm observable Data Upd ...
Property Value Purpose FofXY function handle MATLAB expression (function of two variables). Lm two-element vector Limits over wh ...
Property Value Purpose FcnObject fcneval object This object contains the data that is used to create the function graphs. HAxes ...
Methods Inherited from Handle Class Both the fcneval and fcnview classes inherit methods from the handle class. The following ta ...
Each subplot defines a context menu that can enable and disable the listeners associated with that graph. For example, if you di ...
Similarly, if you change the limits by assigning a value to the feobject.Lm property, the feobject triggers a PostSet property e ...
The notify method triggers an event, and a message is broadcast. The callback function is executed. A listener awaiting the mes ...
events UpdateGraph end Determine When to Trigger Event The fcneval class defines a property set method for the FofXY property. F ...
Here is the fcneval.isSuitable method: function isOk = isSuitable(funcH) v = [1 1;1 1]; % Can the expression except 2 numeric in ...
The fcnview object stores a handle to the event.listener object in its HLUpdateGraph property, which is used to enable/disable t ...
A message is broadcast. The callback function is executed. A listener awaiting the message executes its callback. The SetObserv ...
The PostSet event does not occur until an actual assignment of the property occurs. The property set function provides an opport ...
Enable and Disable Listeners Each fcnview object stores the handle of the listener objects it creates so that the listeners can ...
@fcneval/fcneval.m Class Code classdef fcneval < handle properties FofXY end properties (SetObservable = true) Lm = [-2*pi 2* ...
methods (Static = true) function [x,y] = grid(lim) inc = (lim(2)-lim(1))/20; [x,y] = meshgrid(lim(1):inc:lim(2)); end % grid fun ...
function createLisn(obj) obj.HLUpdateGraph = addlistener(obj.FcnObject,'UpdateGraph',... @(src,evnt)listenUpdateGraph(obj,src,ev ...
end methods (Static) createViews(a) end end @fcnview/createViews function createViews(fcnevalobj) p = pi; deg = 180/p; hfig = fi ...
'HitTest','off',... 'Parent',axh); lims(obj) camlight left; material shiny; grid off colormap copper end function enableLisn(obj ...
How to Build on Other Classes “Hierarchies of Classes — Concepts” on page 12-2 “Subclass Syntax” on page 12-7 “Design Subclass ...
Hierarchies of Classes — Concepts In this section... “Classification” on page 12-2 “Develop the Abstraction” on page 12-3 “Desig ...
«
20
21
22
23
24
25
26
27
28
29
»
Free download pdf