Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
SIMULINK Fixed Point

Subject: SIMULINK Fixed Point

From: Madincea Vasile

Date: 1 Feb, 2007 02:54:10

Message: 1 of 3

Does anyone know how I can easily convert
"sfix(16)_Sp2_B10 (this is the way Simulink displays Fixed Point)
into information like sfix(16), Slope 0.2 Bias 10

if not, I will write the code which translates it, but I just wanted
to know if there is an easier way.

Subject: SIMULINK Fixed Point

From: Praetorian

Date: 1 Feb, 2007 07:52:08

Message: 2 of 3

On Feb 1, 12:54 am, "Madincea Vasile" <vasile.madin...@siemens.com>
wrote:
> Does anyone know how I can easily convert
> "sfix(16)_Sp2_B10 (this is the way Simulink displays Fixed Point)
> into information like sfix(16), Slope 0.2 Bias 10
>
> if not, I will write the code which translates it, but I just wanted
> to know if there is an easier way.

I'm not sure if this is will help you but if you use the function
fixdt it gives you the information you want in the form of a
Simulink.NumericType class object.

fixdt('sfix(16)_Sp2_B10')

ans =

   DataTypeMode: 'Fixed-point: slope and bias scaling'
         Signed: true
     WordLength: 16
          Slope: 0.20000000000000001
           Bias: 10
        IsAlias: false
     HeaderFile: ''
    Description: ''

HTH,
Ashish.

Subject: SIMULINK Fixed Point

From: Madincea Vasile

Date: 2 Feb, 2007 01:25:01

Message: 3 of 3

Thanks so much for the help.
 It works!!!

Praetorian wrote:
>
>
> On Feb 1, 12:54 am, "Madincea Vasile"
<vasile.madin...@siemens.com>
> wrote:
>> Does anyone know how I can easily convert
>> "sfix(16)_Sp2_B10 (this is the way Simulink displays Fixed
Point)
>> into information like sfix(16), Slope 0.2 Bias 10
>>
>> if not, I will write the code which translates it, but I just
> wanted
>> to know if there is an easier way.
>
> I'm not sure if this is will help you but if you use the function
> fixdt it gives you the information you want in the form of a
> Simulink.NumericType class object.
>
> fixdt('sfix(16)_Sp2_B10')
>
> ans =
>
> DataTypeMode: 'Fixed-point: slope and bias scaling'
> Signed: true
> WordLength: 16
> Slope: 0.20000000000000001
> Bias: 10
> IsAlias: false
> HeaderFile: ''
> Description: ''
>
> HTH,
> Ashish.
>
>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us