is there a way to obtain F(-x) polynomial
1 view (last 30 days)
Show older comments
syms x
%if i have
% f is the coeffents of the polynomial
f=[2 43 12];
%F(x) is the polynomial of (+x)
F(x)=poly2sym(f,x)
%F(-x) the poly nomial of(-x)
F(-x)=???
% is there a way to obtain F(-x)?
3 Comments
Torsten
on 14 May 2022
You define a new symbolic function G as G(x) = F(-x). That's what F(-x) means.
Accepted Answer
Voss
on 14 May 2022
Here's a way to do it by operating on the coefficients f rather than the symbolic F(x).
Realize that
- , n even
- , n odd
Therefore, you can obtain the coefficients of F(-x) from the cofficients of F(x) by negating the coefficients of the odd powers of x:
syms x
f=[2 43 12];
%F(x) is the polynomial of (+x)
F(x)=poly2sym(f,x)
%F_(x) is the polynomial of (-x)
f_ = f;
f_(end-1:-2:1) = -f(end-1:-2:1);
F_(x) = poly2sym(f_,x)
1 Comment
Voss
on 14 May 2022
An alternative (maybe more intuitive) way to do the same (multiplying each coefficient by (-1)^n, where n is the corresponding power of x):
syms x
f=[2 43 12];
%F(x) is the polynomial of (+x)
F(x)=poly2sym(f,x)
%F_(x) is the polynomial of (-x)
f_ = f.*(-1).^(numel(f)-1:-1:0);
F_(x) = poly2sym(f_,x)
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!