How to prevent rounding number
이전 댓글 표시
Hello everyone, I have a trouble about rounding. This is my example: I assign K=173.1227 but the numerator the transfer function G is 173.1. When I try K=173.227, the num of G is 173.2. How can I fix that? I try to format long and go to preferences to adjust the variable and command windows but that doesn't work. Please help me! TIA

채택된 답변
추가 답변 (1개)
Your data is still there, its just not printing out the full precision.
See also:
K2 = 173.227;
G2 = tf([K2, conv(1, 0.2)], [1, 8, 20])
G2.numerator
G2.denominator
댓글 수: 2
Hoang Le Tran
2023년 5월 16일
이동: Walter Roberson
2023년 5월 16일
Walter Roberson
2023년 5월 16일
The calculations for the transfer function use the full precision of the values you use to construct the transfer function (or state space system)
Only the display of the transfer function is affected.
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
