| Contents | Index |
y = num2int(q,x)
[y1,y,...] = num2int(q,x1,x,...)
y = num2int(q,x) uses q.format to convert numeric x to an integer.
[y1,y,...] = num2int(q,x1,x,...) uses q.format to convert numeric values x1, x2,... to integers y1,y2,...
All the two's complement 4-bit numbers in fractional form are given by
x = [0.875 0.375 -0.125 -0.625
0.750 0.250 -0.250 -0.750
0.625 0.125 -0.375 -0.875
0.500 0.000 -0.500 -1.000];
q=quantizer([4 3]);
y = num2int(q,x)
y =
7 3 -1 -5
6 2 -2 -6
5 1 -3 -7
4 0 -4 -8
When q is a fixed-point quantizer object, f is equal to fractionlength(q), and x is numeric
![]()
When q is a floating-point quantizer object, y = x. num2int is meaningful only for fixed-point quantizer objects.
bin2num | hex2num | num2bin | num2hex

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |