Posts

Showing posts with the label sym2poly

How to extract coefficients from given symbolic polynomial in MatLab? sym2poly -- MatLab

How to extract coefficients from given symbolic polynomial in MatLab? sym2poly -- MatLab How to extract coefficients from given symbolic polynomial in MatLab?  [Ans] sym2poly  [description] extract coefficients from given polynomial. more details on: Extract vector of all numeric coefficients, including zeros, from symbolic polynomial - MATLAB sym2poly (mathworks.com) code: clear clc syms x c = sym2poly(x^3 - 2*x - 5) fprintf( "1\n" ); c = sym2poly(1/2*x^3 - 2/3*x - 5) fprintf( "2\n" ); result: c = 1 0 -2 -5 1 c = 0.5000 0 -0.6667 -5.0000