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

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com