classdef Num properties value end methods % Constructor function self = Num(n) self.value = n; end % Accessor function disp(self) fprintf('Num: %d\n', self.value); end end methods (Static) function s = sqrt(v) s = sqrt(v); end end end
function test() % Create a Num Object Package.Num.sqrt(10) end