Hello, how can I get the numerical coefficient of a term?
5*x*y
coeff(5*x*y, y,1); returns 5*x // ok 5·x is the coefficient of y¹
coeff(5*x*y, x,1); returns 5*y // ok 5·y is the coefficient of x¹
coeff(5*x*y, 'x*y' ) ; returns 5*x*y =( // 5 is the coefficient of x¹·y¹
numerical coefficient of a term
Modérateur : xcasadmin
-
- Messages : 561
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: numerical coefficient of a term
coeff(poly,[x,y],[1,1]) will return the x^1*y^1 coefficient:
>> coeff(5*x*y,[x,y],[1,1])
5
>> coeff(5*x*y,[x,y],[1,1])
5
-
- Messages : 561
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: numerical coefficient of a term
coeff(5*x^3*y,[x,y],[1,1]) returns 0 =(
I think Bernard, could improve this function, if specified in the third argument, a string with the variables to get the coefficient
coeff(5*x*y, "x*y" ) => 5
coeff(5*x^3*y, "x*y" ) => 5
I think Bernard, could improve this function, if specified in the third argument, a string with the variables to get the coefficient
coeff(5*x*y, "x*y" ) => 5
coeff(5*x^3*y, "x*y" ) => 5
Re: numerical coefficient of a term
coeff(5*x^3*y,[x,y],[1,1]) *is* 0.
Why would you want a string as second argument ?
Why would you want a string as second argument ?