Embedded coder - how to control types of temporary variables within embedded Matlab function blocks
Show older comments
I'm generating code from simulink using embedded coder. In my simulink model I have an embedded matlab function containing the matlab command eig. When I try to compile the generated c-code in microCforPic32 I get errors on out of range numbers. In matlab double precision is standard, but my target processor is 32 bit, so I guess I would like to use single precision but dont see how I can set this for the temporary variables generated from matlabs own functions such as eig(). Below is part of the generated code:
/* Function for MATLAB Function: '<S17>/Eig' */ static void Calib_eml_matlab_ztgevc(const creal_T A[4], creal_T V[4]) {...
Heres one of the lines within this function that cause troubles y = anorm; if (2.2250738585072014E-308 > anorm) { y = 2.2250738585072014E-308; }
The tpe of y is defined in top of the function
real_T y;
Where real_T stands for double 64-bit, i'm pretty sure.
I've tried to set the largest atomic size to float but does not change the value 2.2250738585072014E-308. I could of course change it mannualy in the c-code but I would prefer to solve it in matlab.
2 Comments
Walter Roberson
on 5 Dec 2013
I wonder if you should be using the fixed point toolbox ?
Rebecka
on 5 Dec 2013
Answers (0)
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!