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
1) defaultcoef('co',['=' ; '+' ; '(' ; '-' ; '*'],['+' ; '-' ; '*' ; '/' ; ')'],'y=co1+co2*x1+(co3-co2)*x2') 2) grocer_namecoef=defaultcoef('a',grocer_speccarb,grocer_speccara,varargin(:)) In example1, the coefficients are prefixed by co; they are asumed to be preceded by '=', '+', '(', '-' or '*' and followed by '+', '-', '*', '/', or ')'; the equation is 'y=co1+co2*x1+(co3-co2)*x2'. The result is: !co1 ! ! ! !co2 ! ! ! !co3 ! Example 2 is taken from function sur.