| MATLAB Function Reference | ![]() |
superiorto('class1', 'class2', ...)
The superiorto function establishes a precedence that determines which object method is called.
Note You can use this function only from a constructor that calls the class function to create an object, which was the only way to create MATLAB® classes prior to MATLAB Version 7.6. |
See MATLAB® Classes and Object-Oriented Programming for information on the creating MATLAB classes.
superiorto('class1', 'class2', ...) invoked within a class constructor method, establishes that class as having precedence over the classes in the function argument list for purposes of function dispatching (i.e., which method or function is called in any given situation).
Suppose a is an object of class 'class_a', b is an object of class 'class_b' and c is an object of class 'class_c'. Also suppose the constructor method for class_c.m contains the statement superiorto('class_a'). Then, either of the following two statements:
e = fun(a,c); e = fun(c,a);
invokes class_c/fun.
If a function is called with two objects having an unspecified relationship, the two objects are considered to have equal precedence, and the left-most object's method is called. So fun(b,c) calls class_b/fun, while fun(c,b) calls class_c/fun.
![]() | sum (timeseries) | support | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |