This enhancement has been incorporated in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The ability to perform mathematical operations using integers in an Embedded MATLAB function block is not available in Simulink. This is stated as a caveat in the documentation for the Embedded MATLAB function block under the "Data Type Support" section, available by typing the following at the MATLAB 7.0 (R14) prompt:
web([docroot '/toolbox/simulink/slref/embeddedmatlabfunction.html'])
To work around this issue, perform mathematical operations using data of type double or single; afterwards convert the result to an integer, as accomplished with the following code:
y = int8((single(x1)+single(x2))/single(4));
Best Answer