The combine(S) and horner(p) functions did not work as expected?

2 ビュー (過去 30 日間)
Rarity Brown
Rarity Brown 2024 年 6 月 16 日
移動済み: Walter Roberson 2024 年 6 月 17 日
Code:
clear i
syms C_F C_L C_GS g_m R_L omega positive
s = i*omega;
Y_in=(1-(s*C_F-g_m)/(1/R_L+s*C_F+s*C_L))*s*C_F+s*C_GS
Y_in = 
Re = real(Y_in)
Re = 
[N,D] = numden(simplify(Re))
N = 
D = 
D-1
ans = 
combine(D-1)
ans = 
horner(D-1)
ans = 
D
D = 
combine(D)
ans = 
horner(D)
ans = 
Behavior:
  3 件のコメント
Rarity Brown
Rarity Brown 2024 年 6 月 17 日
編集済み: Rarity Brown 2024 年 6 月 17 日
Thank you for your reply.
The desired output is in the form of a product of factors that has been combined, like the larger font size formulas on the right side of the image. (a+b)^2=a^2+2ab+b^2
Or is this combination not the expected behavior of the combine function? In that case, is there any function to reach my desired output?
Torsten
Torsten 2024 年 6 月 17 日
simplify(combine(D-1))
For combine(D), this doesn't work.

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

回答 (1 件)

Ganesh
Ganesh 2024 年 6 月 17 日
移動済み: Walter Roberson 2024 年 6 月 17 日
The combine function is meant to act as a way to combine the powers of an equation. The horner function will be useful when you have a nested "polynomial" expression. In your case, neither of these functions will be of use. You can infact achieve what youre trying to do with "simplify()".
clear i
syms C_F C_L C_GS g_m R_L omega positive
s = i*omega;
Y_in=(1-(s*C_F-g_m)/(1/R_L+s*C_F+s*C_L))*s*C_F+s*C_GS;
Re = real(Y_in);
[N,D] = numden(simplify(Re));
simplify(D-1)
ans = 
  1 件のコメント
Rarity Brown
Rarity Brown 2024 年 6 月 17 日
移動済み: Walter Roberson 2024 年 6 月 17 日
greatly appreciated!

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

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by