defaultcoef — finds default coefficients in equations
coef=defaultcoef(defaultname,speccarb,speccara,arg1, ,argn)
defaultname = a string (default prefix of the coefficients)
speccarb = the characters that must be before a coefficient to be sure that defaultname is not part of the name of another object
speccara = the characters that must be after a coefficient to be sure that defaultname is not part of the name of another object
argi = a string representing the text of an equation
coef=a (nx1) vector of coefficients names
defaultcoef('co',['=' ; '+' ; '(' ; '-' ; '*'],['+' ; '-' ; '*' ; '/' ; ')'],'y=co1+co2*x1+(co3-co2)*x2') //The coefficients are supposed prefixed by co, to be preceded by '=', '+', '(', '-' or '*' and followed by '+', '-', '*', '/', or ')'; // the equation is 'y=co1+co2*x1+(co3-co2)*x2'. // and the result is: //!co1 ! //! ! //!co2 ! //! ! //!co3 ! grocer_namecoef=defaultcoef('a',grocer_speccarb,grocer_speccara,varargin(:)) // Example taken from function sur.