I am currently working on simulink model. One of the equations is "L = qf*(XL0+(XL1*alpha_quadrant))" where "alpha_quadrant" is constantly zero. "XL0" and "qf" are both constants. The result of the equation, when graphed, should be constantly -11.08, but as it can be seen in the picture the result keeps fluttering.
Kshitij Singh answered .
2025-11-20
format long g % will shows higher precision than short, but can still hide some differences a = 0.05; b = a + eps(a); c = a + 2*eps(a); v = [c,a,b] % the differences will not be visible in the command window % converting to a string with 17 digits will be enough to see differences mat2str(v,17) % subtracting values is another way to make the differences visible in the % command window dv = diff(v) max(dv) min(dv)
The output of this code is:
v =
0.05 0.05 0.05
ans =
'[0.050000000000000017 0.050000000000000003 0.05000000000000001]'
dv =
-1.38777878078145e-17 6.93889390390723e-18
ans =
6.93889390390723e-18
ans =
-1.38777878078145e-17