Sum polynomials function help?
古いコメントを表示
Hello Experts,
I have 2 or more polynomials of different degrees. Let x1 = [1,2,3,4] and x2=[5,6,7,8,9,10]
I need to sum x1 and x2 polynomials, please tell me what function does it.
Will appreciate any help.
採用された回答
その他の回答 (2 件)
John D'Errico
2011 年 10 月 7 日
1 投票
These are not truly polynomials. They are vectors of coefficients, that you choose to interpret as polynomials. How do you add them? Trivial. Pad the shorter one with zeros on the left, so they two vectors are the same length. Then adding the two vectors is truly trivial.
3 件のコメント
Steve
2011 年 10 月 7 日
Walter Roberson
2011 年 10 月 8 日
Find the max() of the length() of the coefficient vectors, and pad everything on the left to match that size, and then just add the padded vectors.
Steve
2011 年 10 月 8 日
basilis
2022 年 11 月 7 日
0 投票
hello experts,i have 2 polynomials to sum with different degree in line 16 (error)
clc
clear
%%Data Input
k=5*(10^6);
m=1000;
a=k/(4*m*(pi^2));
p1=[-1 0 a];
p2=[-1 0 2*a];
p3=[a^2 0 -2*(a^3)];
%%Calculations
p4=p2.^2-a^2;
p5=conv(p1,p4);
P=p3+p5;
roots(P)
%%Results Output
disp('the frequences are:')
カテゴリ
ヘルプ センター および File Exchange で Polynomials についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!