|
Hi fl,
This is what you probably want:
T = numerictype(true,10, 9);
a = fi(0,T,'bin','0010110101')
a =
0.3535
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 10
FractionLength: 9
Now at any time you can do:
a.bin = newbinnvalue; % where newbinvalue is a binary string
Hope this helps,
Ashok Charry
The MathWorks.
fl wrote:
> On Jun 26, 11:50 am, Nathan <ngrec...@gmail.com> wrote:
>> On Jun 26, 8:47 am, fl <rxjw...@gmail.com> wrote:
>>
>>> Hi,
>>> I have a defined numerical type, for example, T = numerictype(true,
>>> 10, 9);
>>> I get a binary number: 0010110101.
>>> I want to get the real value of the binary number interpreted by
>>> numerical type T. I don't find any function in fixed point for my
>>> question. Could you tell me that? Thanks.
>> Do you mean you want the decimal (base 10) value for your binary
>> number?
>> If so: doc bin2dec
>>
>> Hope that helps.
>> -Nathan
>
> Thank.
> According to the numerical type definition of fixed point toolbox, the
> data has a fraction. It is not an integer.
|