필터 지우기
필터 지우기

Simulink Compiled Code NaN

조회 수: 1 (최근 30일)
B. J.
B. J. 2011년 8월 10일
Hello,
I have a theoretical question I am unable to test right now...if I compile some simulink code down, and pass some "bad" data into it, what type of error handling would I receive? For example, if my simulink code was simply x (input)
y = 3*x(1)/x(2)
And I managed to have x(1) = NaN...or worse, x(2) = 0, what would my compiled code throw me?
thanks, B.

채택된 답변

Mike Hosea
Mike Hosea 2011년 8월 10일
Look under
Simulation-->Configuration Parameters-->Diagnostics-->Data Validity
There is a setting for "Inf or NaN block output". You can set it to "none", "warning", or "error". That's in simulation, of course. If you build code for some standalone target, e.g. exe, then you will not get an error or a warning for this condition, just Infs or NaNs, as the case may be. -- Mike

추가 답변 (1개)

B. J.
B. J. 2011년 8월 10일
A follow on thought...can I somehow use the model advisor to specify how I want it to handle these errors?

카테고리

Help CenterFile Exchange에서 Simulink Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by