problem with symbolic factorization with two symbols
古いコメントを表示
The output is not a factorized one. I want this form : (s+s1)*(s+s2)*(s+s3). What is the problem?
syms s K
factor(s^3 + 10*s^2 + (21+K)*s + 4*K, [s, K],'FactorMode','full')
The output is
4*K + 21*s + K*s + 10*s^2 + s^3
1 件のコメント
Dyuman Joshi
2023 年 10 月 21 日
It is factorized according to the inputs given.
From the documentation - F = factor(x,vars) returns an array of factors F, where vars specifies the variables of interest. All factors not containing a variable in vars are separated into the first entry F(1). The other entries are irreducible factors of x that contain one or more variables from vars.
Note the last sentence.
What is the expected output from the vectorization?
採用された回答
その他の回答 (1 件)
Here are the factors:
syms s K
eqn = s^3 + 10*s^2 + (21+K)*s + 4*K == 0;
factors = solve(eqn,s,'MaxDegree',3)
2 件のコメント
Dyuman Joshi
2023 年 10 月 21 日
Shouldn't the factors be
s - roots_of_equation
Torsten
2023 年 10 月 21 日
Yes, I should have said: -s1, -s2 and -s3 from the factorization (s+s1)*(s+s2)*(s+s3).
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







