Mercurial > hg > octave-nkf
comparison examples/@polynomial/subsref.m @ 9332:bf6da2fbfa4e
examples/polynomial: properly handle magic colon
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 11 Jun 2009 12:37:04 +0200 |
parents | 226f6d001ee2 |
children |
comparison
equal
deleted
inserted
replaced
9331:a76f391a3d02 | 9332:bf6da2fbfa4e |
---|---|
13 case "{}" | 13 case "{}" |
14 ind = s(1).subs; | 14 ind = s(1).subs; |
15 if (numel (ind) != 1) | 15 if (numel (ind) != 1) |
16 error ("polynomial: need exactly one index"); | 16 error ("polynomial: need exactly one index"); |
17 else | 17 else |
18 b = a.poly(ind{1}+1); | 18 if (isnumeric (ind{1})) |
19 b = a.poly(ind{1}+1); | |
20 else | |
21 b = a.poly(ind{1}); | |
22 endif | |
19 endif | 23 endif |
20 case "." | 24 case "." |
21 fld = s.subs; | 25 fld = s.subs; |
22 if (strcmp (fld, "poly")) | 26 if (strcmp (fld, "poly")) |
23 b = a.poly; | 27 b = a.poly; |