Mercurial > hg > octave-nkf
diff examples/polynomial/get.m @ 8223:0c91b9a17dcf
Commit missing files from previous change
author | David Bateman <dbateman@free.fr> |
---|---|
date | Thu, 16 Oct 2008 09:20:58 +0100 |
parents | |
children |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/examples/polynomial/get.m @@ -0,0 +1,18 @@ +function s = get (p, f) + if (nargin == 1) + s.poly = p.poly; + elseif (nargin == 2) + if (ischar (f)) + switch (f) + case "poly" + s = p.poly; + otherwise + error ("get: invalid property %s", f); + endswitch + else + error ("get: expecting the property to be a string"); + endif + else + print_usage (); + endif +endfunction