Get max, min and precision of a fi
14 views (last 30 days)
Show older comments
What is the easiest way to find the maximum or minimum value that a fi can take?
What is the easiest way to find the precision of a fi?
0 Comments
Accepted Answer
Jan
on 27 Mar 2019
Edited: Jan
on 28 Mar 2019
a = fi(pi, true, 16, 12);
xi = intmax(a)
This is code taken from https://www.mathworks.com/help/fixedpoint/ref/intmax.html , which I found as first link by asking an internet search engine for "Matlab fi maximum value".
a = fi(pi, true, 16, 12);
xd = realmax(a)
3 Comments
Jan
on 28 Mar 2019
I cannot test this, because I do not have the FI toolbox. But what about realmax?
More Answers (2)
Harry
on 30 Jul 2021
Edited: Harry
on 30 Jul 2021
% A fixed-point object with no value, 18-bit word length, and 16-bit fraction length
a = fi([],1,18, 16)
% The easiest way to find the maximum or minimum value that a fi can represent is
range(a)
% The easiest way to find the precision of a fi is
eps(a)
0 Comments
See Also
Categories
Find more on Create Fixed-Point Objects in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!