Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
PETROS CHARMPATSIS
PETROS CHARMPATSIS am 2 Nov. 2023
Beantwortet: Walter Roberson am 2 Nov. 2023
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

Antworten (1)

Walter Roberson
Walter Roberson am 2 Nov. 2023
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.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by