view examples/polynomial/end.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 source

function r = end (obj, index_pos, num_indices)
  dv = size (obj.x);
  for i = (num_indices + 1) : length (dv)
    dv(num_indices) *= dv(i);
  endfor
  if (index_pos <= length (dv))
    r = dv (index_pos);
  elseif
    r = 1;
  endif
endfunction