Mercurial > octave-nkf
view test/classdef/foo_static_method_constant_property.m @ 20616:fd0efcdb3718
use new string_value method to handle value extraction errors
* dirfns.cc, file-io.cc, gammainc.cc, help.cc, load-path.cc,
octave-link.cc, qz.cc, regexp.cc, strfns.cc, syscalls.cc, time.cc,
variables.cc: Use new string_value method.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 08 Oct 2015 19:00:51 -0400 |
parents | a3d7b927ce47 |
children |
line wrap: on
line source
classdef foo_static_method_constant_property properties frequency; end properties (Constant = true) pie = pi; end methods function obj = foo_static_method_constant_property (f) if (nargin == 1) obj.frequency = f; elseif (nargin ~= 0) error ('foo_static_method_constant_property:SyntaxError', ... 'foo_static_method_constant_property: Invalid syntax') end end function res = cosine (obj, t) res = cos (obj.radians_per_cycle () * obj.frequency * t); end function res = sine (obj, t) res = sin (obj.radians_per_cycle () * obj.frequency * t); end end methods (Static) function res = radians_per_cycle () res = 2 * foo_static_method_constant_property.pie; end end end