Mercurial > hg > octave-nkf
diff examples/@polynomial/end.m @ 9285:226f6d001ee2
further improve the polynomial example, fix indexing
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 02 Jun 2009 09:06:49 +0200 |
parents | 567e3e4ab74d |
children | 7621f0b0e588 |
line wrap: on
line diff
--- a/examples/@polynomial/end.m +++ b/examples/@polynomial/end.m @@ -1,13 +1,9 @@ function r = end (obj, index_pos, num_indices) - if ( num_indices!=1 ) + if (num_indices != 1) error ("polynomial object may only have one index") endif - if ( (index_pos<1) || (index_pos>length(obj.poly)) ) - error ("subscript out of range") - end - - r = length(obj.poly); + r = length (obj.poly); endfunction