How to stop matlab generating (4.94065645841247E-324)

1 view (last 30 days)
Hello, I have to convert a matlab simulink file to C based s-function. to code is generated very well but when i want to load it to Dspace it gives me this error: "floating constant is out of range absb = 4.94065645841247E-324;" how can i reduce the precision in order to load the code on dspace? i tried several ways but i couldn't. thank you in advance.
  2 Comments
dpb
dpb on 8 Apr 2014
Looks to me likely you've got a type declaration wrong and are trying to load a float with a non-floating point value.
Need to see the code that generated the problem methinks to have any klew...
Ivan Surovtcev
Ivan Surovtcev on 13 Sep 2015
Hello!
I have the same problem: also while generating code for dSpace.
The error is caused by the 5-th line of code:
speedPredPolObj = polyfit(timeFit',objHist(:,1),degPolSpeed);
betaPredPolObj = polyfit(timeFit',objHist(:,2),degPolAngle);
s_pred = polyval(speedPredPolObj, timePred);
b_pred = polyval(betaPredPolObj, timePred);
objPredOut(1,1:timePredLen,i) = objDataIn(5,i) + cumsum(s_pred.*cos(b_pred)*predStepIn);
Do you have any idea why it happens and how to fix it?
Thank you in advance!

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!