How can I infer the solutions of a specific polynomial?
1 次查看(过去 30 天)
显示 更早的评论
% A
v1 = [1 -2 -5 6] % Storing the values of the polynomial
% B
v2 = [-100 : .1 : 100] % Sequencing the numbers in .1 steps
% C
y = polyval (v1, v2) % Polyval function
plot(v2, y) % Plotting
How can I infer the solutions of the polynomial?
0 个评论
回答(1 个)
Matt J
2022-5-4
编辑:Matt J
2022-5-4
v1 = [1 -2 -5 6] ;
roots(v1)
1 个评论
Walter Roberson
2022-5-4
v1 = [1 -2 -5 6]
r = roots(v1)
mask = imag(r) ~= 0 | real(r) < -100 | real(r) > 100; %remove anything not in -100 to +100
r(mask) = []
r
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!