comparison examples/polynomial/subsref.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
comparison
equal deleted inserted replaced
8222:11badf6c9e9f 8223:0c91b9a17dcf
1 function b = subsref (a, s)
2 switch s.type
3 case "()"
4 ind = s.subs;
5 b = polyval (fliplr(a.poly), ind{:});
6 case "{}"
7 ind = s.subs;
8 b = polynomial (a.poly(ind{:}));
9 case "."
10 fld = s.subs;
11 if (strcmp (fld, "poly"))
12 b = a.poly;
13 else
14 error ("subsref: unrecognized property \"%s\" of a polynomial", fld);
15 endif
16 endswitch
17 endfunction