Grocer Function
NAME
defaultcoef - finds default coefficients in equations
CALLING SEQUENCE
coef=defaultcoef(defaultname,speccarb,speccara,arg1,...,argn)
PARAMETERS
Input
-
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
Output
coef=a (nx1) vector of coefficients names
DESCRIPTION
Determines the list of default coefs names in a set of equations
EXAMPLE
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.
AUTHOR
Eric Dubois 2002