Grocer Function
NAME
defaultcoef - Finds default coefficients names
CALLING SEQUENCE
coef=defaultcoef(defaultname,speccarb,speccara,varargin)
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 an other object
-
speccara = the characters that must be after a coefficient to be sure that defaultname is not part of the name of an other object
-
varargin = strings equal to the texts of the equations
Output
-
coef=a (nx1) vector of coefficients names
DESCRIPTION
Determines the list of default coefs names in a set of equations.
EXAMPLE
1) coef=defaultcoef('a',['=';'+'],['+';'*'],'y1=a1+a2*x1','y2=a3+a4*(y1-x2)+a2*x2')
2) grocer_namecoef=defaultcoef('a',grocer_speccarb,grocer_speccara,varargin(:))
Example 1 gives the matrix ['a1';'a2';'a3';'a4'].
Example 2 is taken from function sur.
Default car is 'a'; grocer_speccarb and grocer_speccara are given before in the function
(respectively ['+' ; '(' ; '-' ; '*'] and ['+' ; '-' ; '*' ; '/' ; ')']; varargin(:) is the list of
variables arguments passed to function sur.
AUTHOR
Eric Dubois 2002