I get these results. How can I make the small decimal zeros?
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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)
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!