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!