フィルターのクリア

I get these results. How can I make the small decimal zeros?

1 回表示 (過去 30 日間)
PETROS CHARMPATSIS
PETROS CHARMPATSIS 2023 年 11 月 2 日
回答済み: Walter Roberson 2023 年 11 月 2 日
0.004 s^4 + 7.426e-18 s^3 + 3.2 s^2 + 5.7077e-15 s
--------------------------------------------------
s^4 + 110 s^3 + 1020 s^2 + 8000 s + 16000

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 11 月 2 日
tol = 1e-7;
s = tf('s');
G = (0.004 * s^4 + 7.426e-18 * s^3 + 3.2 * s^2 + 5.7077e-15 * s) / ( s^4 + 110 * s^3 + 1020 * s^2 + 8000 * s + 16000)
G = 0.004 s^4 + 7.426e-18 s^3 + 3.2 s^2 + 5.708e-15 s ------------------------------------------------- s^4 + 110 s^3 + 1020 s^2 + 8000 s + 16000 Continuous-time transfer function.
Num = G.Numer; Den = G.Denom;
Adjust = @(V) V .* (abs(V) > tol);
Num = cellfun(Adjust, Num, 'uniform', 0);
Den = cellfun(Adjust, Den, 'uniform', 0);
G = tf(Num, Den)
G = 0.004 s^4 + 3.2 s^2 ----------------------------------------- s^4 + 110 s^3 + 1020 s^2 + 8000 s + 16000 Continuous-time transfer function.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by