Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: ssGetOutputPortDataType
Replies: 1   Last Post: Jul 11, 2013 8:42 AM

 Messages: [ Previous | Next ]
 Steve Conahan Posts: 12 Registered: 7/11/13
Re: ssGetOutputPortDataType
Posted: Jul 11, 2013 8:42 AM

Hi, After you have the data type ID (the return value from
ssGetOutputPortDataType), then you can use code similar to that from this
Fixed-Point S-Function Example to get fixed-point (sign, word length,
scaling) information from it:

http://www.mathworks.com/help/fixedpoint/ug/fixed-point-s-function-examples.html#f7973

In particular, the following API functions may be helpful to you:

ssGetDataTypeFxpIsSigned
ssGetDataTypeFxpWordLength
ssGetDataTypeFracSlope
ssGetDataTypeFixedExponent
ssGetDataTypeTotalSlope
ssGetDataTypeBias

These terms are further explained here:

http://www.mathworks.com/help/fixedpoint/data-types-and-scaling.html

Best regards, Steve

"Prabhakaran thirugnanam" <tpkaran1985@yahoo.com> wrote in message
news:krh07i\$i0d\$1@newscl01ah.mathworks.com...
> The S-function API, ssGetOutputPortDataType() function returns the data
> type ID as below
> 0 SS_DOUBLE
> 1 SS_SINGLE
> 2 SS_INT8
> 3 SS_UINT8
> 4 SS_INT16
> 5 SS_UINT16
> 6 SS_INT32
> 7 SS_UINT32
> 8 SS_BOOLEAN
>
> But If the datatype is scaled(i.e fixdt()...) It returns 15 for all scaled
> datatypes(fixdt(1,16,0), fixdt(1,8,0)......). How can I obtain the exact
> datype of my outport?
>

Date Subject Author
7/9/13 Prabhakaran thirugnanam
7/11/13 Steve Conahan