classdef
Begins a class definition.
Syntax
classdef(my_class)
classdef(my_class, base_class)
classdef(my_class, base_class1, base_class2)
Inputs
- my_class
- The name of the class being defined.
- base_class
- The name(s) of any class(es) that this class is derived from.
Example
Define a new class named Circle that derives from the built-in handle base
class:
classdef Shape < handle
properties
radius
end
methods
function self=Shape(r)
self.radius = r;
end
end
end