view examples/@polynomial/set.m @ 14354:55bb8c902a4d

maint: Remove deprecated functions from dev branch for next (3.8) release. * NEWS: Update list of deprecated functions which had duplicates and missing functions * deprecated/module.mk: Remove deprecated m-files from build system. * autocor.m, autocov.m, betai.m, cellidx.m, clg.m, cquad.m, dispatch.m, fstat.m, gammai.m, glpkmex.m, intwarning.m, is_duplicate_entry.m, is_global.m, krylovb.m, perror.m, replot.m, saveimage.m, strerror.m, values.m, weibcdf.m, weibinv.m, weibpdf.m, weibrnd.m: Remove deprecated functions from Mercurial.
author Rik <octave@nomad.inbox5.com>
date Thu, 09 Feb 2012 13:16:39 -0800
parents 567e3e4ab74d
children
line wrap: on
line source

function s = set (p, varargin)
  s = p;
  if (length (varargin) < 2 || rem (length (varargin), 2) != 0)
    error ("set: expecting property/value pairs");
  endif
  while (length (varargin) > 1)
    prop = varargin{1};
    val = varargin{2};
    varargin(1:2) = [];
    if (ischar (prop) && strcmp (prop, "poly"))
      if (isvector (val) && isreal (val))
        s.poly = val(:).';
      else
        error ("set: expecting the value to be a real vector");
      endif
    else
      error ("set: invalid property of polynomial class");
    endif
  endwhile
endfunction