Let say that we have the polynomial f=a^2*b+b^2*c+c*d
.
I would like to know if, in Matlab, I could find all the terms of f
that
contain specific polynomials of variables a
, b
, c
and d
.
For example, if I have a polynomial of variable c
, that is g=b
,
then I want to find out the terms: a^2+b*c
.
If I have a polynomial of variable b
, that is g=c
,
then I want to find out the terms: b^2+d
.
It is like to take a common factor (polynomial of a variable) and then to find the terms that contains this factor.
I know that I can use factor()
, but I have polynomials in which the usage of factor()
does not work, because they cannot be written as a product of polynomials.