The attached model uses a Data Type Conversion block to convert fixed-point scaling. The following code is expected to be generated:
dtc_test001_Y.Out1 = dtc_test001_U.In1 / 10U;
However, the code is generated as follows:
dtc_test001_Y.Out1 = (uint16_T)((uint32_T)dtc_test001_U.In1 * 52429UL >> 19);
Best Answer