9ff4e5bRestructure demo into a full guided tour with OOP and namespacesJeremy Magland 1classdef Point
2 % A class that lives inside the +geom package: geom.Point(...).
3 properties
4 x = 0
5 y = 0
6 end
7 methods
8 function obj = Point(x, y)
9 if nargin > 0, obj.x = x; obj.y = y; end
10 end
11 function d = dist(obj)
12 d = sqrt(obj.x^2 + obj.y^2);
13 end
14 end
15end