Mercurial > octave
changeset 23411:98bf881fafd1
doc: improve @polynomial example class constructor
* examples/code/@polynomial/polynomial.m: Avoid meaningless brackets and
prefer isa() function to string comparision.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Wed, 19 Apr 2017 01:30:09 +0200 |
parents | 705361dfe353 |
children | 7b95435e96a4 |
files | examples/code/@polynomial/polynomial.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/code/@polynomial/polynomial.m Wed Apr 19 01:28:07 2017 +0200 +++ b/examples/code/@polynomial/polynomial.m Wed Apr 19 01:30:09 2017 +0200 @@ -18,10 +18,10 @@ endif if (nargin == 0) - p.poly = [0]; + p.poly = 0; p = class (p, "polynomial"); else - if (strcmp (class (a), "polynomial")) + if (isa (a, "polynomial")) p = a; elseif (isreal (a) && isvector (a)) p.poly = a(:).'; # force row vector