Get max, min and precision of a fi
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Jan
el 27 de Mzo. de 2019
Editada: Jan
el 28 de Mzo. de 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 comentarios
Jan
el 28 de Mzo. de 2019
I cannot test this, because I do not have the FI toolbox. But what about realmax?
Más respuestas (2)
Harry
el 30 de Jul. de 2021
Editada: Harry
el 30 de Jul. de 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 comentarios
Ver también
Categorías
Más información sobre Fixed-Point Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!