Coeffs of non linear product terms
Show older comments
I need to find coefficient of a product term in a symbolic expression. An exaple is:
syms x y
[c, v] = coeffs(x+y+2*x*y,x*y);
But this code gives an error: Error in MuPAD command: The indeterminate is invalid. [coeff]
I know that if I write
[c, v] = coeffs(x+y+2*x*y,[x,y]);
then the first term will be the coefficiet of product term, but I need to get the coeff of only the product term. Also, I'm concerned about execution time, so I want to do it in minimum possible lines. I dont want to use an if loop to check which element in c is the product term. Does anyone know how I can possibly find the coefficient of a specific product term.
Accepted Answer
More Answers (1)
Punit
on 4 Oct 2012
0 votes
Categories
Find more on Common Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!