Reputation: 527
I'm trying to find the equivalent to Matlabs coeff function in Octave, but i'm unsure which one is correct since the description of the ones google turns up differ from the matlab page.
Upvotes: 1
Views: 231
Reputation: 8091
I doubt this is in core Matlab, the page you linked says "Use only in the MuPAD Notebook Interface."
In GNU Octave you may use the symbolic octave-forge package. On a GNU/Linux system simply do:
pkg -forge install symbolic #only once to install
pkg load symbolic
f = sym ("10*x^10 + 5*x^5 + 2*x^2")
coeffs(f)
which outputs:
OctSymPy: Communication established. SymPy v0.7.5.
f = (sym)
10 5 2
10⋅x + 5⋅x + 2⋅x
octave:3> coeffs(f)
ans = (sym 1×3 matrix)
[10 5 2]
Type "help @sym/coeffs" in Octave to see what the symbolic coeffs can do for you. Of course you have to install python and sympy before you can use it from symbolic.
Upvotes: 3