Dividing two vectors of different sizes

6 ビュー (過去 30 日間)
Aleem Andrew
Aleem Andrew 2021 年 3 月 15 日
コメント済み: Matt J 2021 年 3 月 15 日
If you have two vectors a = [1 2 1]; b = [1 1] that represent polynomials can you divide a by b to get [1 1] as the answer, since (s^2+2s+1)/(s+1) = s+1? I know you can divide the vectors by first converting them to polynomials using poly2sym(a)/poly2sym(b) and then extract the coefficients but is there a simpler way?

採用された回答

Matt J
Matt J 2021 年 3 月 15 日
編集済み: Matt J 2021 年 3 月 15 日
Yep. Just use deconv.
deconv([1,2,1],[1,1])
ans = 1×2
1 1
  3 件のコメント
Aleem Andrew
Aleem Andrew 2021 年 3 月 15 日
Can you divide vectors with deconv or a similar method if the numerator's degree is smaller than the denominator's? I get the incorrect answer 0 when I do so instead of the equivalent of (s+3)/(s^3+17s^2+14s+8).
numg=[1 3]; deng=[1 7 14 8];
deconv(numg,deng)
Matt J
Matt J 2021 年 3 月 15 日
What do you think the result should be?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by