select a range of coefficients of a polynme

1 Ansicht (letzte 30 Tage)
Marouane RHAFLI
Marouane RHAFLI am 29 Dez. 2021
Kommentiert: Marouane RHAFLI am 29 Dez. 2021
Hi all,
The c result, gives me coefficient from 1, I would like to bypass the first coefficient and select the 5 following ones, but I don't know how.
Here is the code I am developing
prime = 'What is the same prime factor? ';
OddComposite = 'What is the Odd composte N? ';
Zed = 'What is Z? ';
p = input(prime)
N = input(OddComposite)
z = input(Zed)
x= z
y= 2*x - 1
syms m
eqn = p^2 + 2*p*m == p*N;
M = solve(eqn,m)
Alpha = x - 2
H = z - 2
syms x1 y1
Polynome = expand((x1+y1)^z)
c = coeffs(Polynome)
Could you assist me please, I am pretty new to Matlab

Akzeptierte Antwort

Torsten
Torsten am 29 Dez. 2021
Bearbeitet: Torsten am 29 Dez. 2021
What do you mean by "gives me coefficient from 1" ?
If you want to suppress the coefficient of x1^5, use
c = coeffs(Polynome);
c = c(2:end)
If you want to suppress the coefficients of x1^5 and y1^5, use
c = coeffs(Polynome);
c = c(2:end-1)

Weitere Antworten (0)

Produkte


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by