1classdef foo_static_method_constant_property 2 properties 3 frequency; 4 end 5 properties (Constant = true) 6 pie = pi; 7 end 8 methods 9 function obj = foo_static_method_constant_property (f) 10 if (nargin == 1) 11 obj.frequency = f; 12 elseif (nargin ~= 0) 13 error ('foo_static_method_constant_property:SyntaxError', ... 14 'foo_static_method_constant_property: Invalid syntax') 15 end 16 end 17 function res = cosine (obj, t) 18 res = cos (obj.radians_per_cycle () * obj.frequency * t); 19 end 20 function res = sine (obj, t) 21 res = sin (obj.radians_per_cycle () * obj.frequency * t); 22 end 23 end 24 methods (Static) 25 function res = radians_per_cycle () 26 res = 2 * foo_static_method_constant_property.pie; 27 end 28 end 29end 30