- Include fixedpoint.h and fixedpoint.c as described here.
- Use ssRegisterDataTypeFxpBinaryPoint to register the desired fixed-point datatype and get its datatype ID.
- Set the output datatype by passing the Datatype ID returned in (2) to ssSetOutputPortDataType.
How to set the datatype of outport of an S function to Fixed point datatype force fully ?
2 views (last 30 days)
Show older comments
I am doing some S function releatd things. I need to set my s function output port datatype as a fixed point datatype with some resolution and offset.
Using function "mdlSetDefaultPortDataTypes" I am able to set the output port datatype as direct datatype only(like SS_UINT8). But not able to set some fixed point datatype.
Please suggest How to do that?
Thanks in Advance Rahul VP
0 Comments
Accepted Answer
Kaustubha Govind
on 16 May 2012
2 Comments
NithinRaj
on 17 May 2012
Hi,
If we use function like "ssGetDataTypeFracSlope" releated to fixedpoint then while mexing the s function c file, then you need to Pass an extra argument, -lfixedpoint, to the mex command. For example,
mex('sfun_user_fxp_asr.c','-lfixedpoint')
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!