Can Embedded MATLAB create C code that generates an error message?

3 views (last 30 days)
I would like to include error checking in my C code generated from Embedded MATLAB. For example, if I need to check to see if some variable "x" is zero and throw an error if it is, my Embedded MATLAB code would look like this:
if x==0,
eml.error('Some Error Message')
end
where "eml.error" is the function I would like. It could generate C code that throws the error I specify.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Jan 2010
There is no Embedded MATLAB function that auto generates C code that throws an error message.
To workaround this issue, you can use the "eml.ceval" functionality to insert your own C code in the generated code.

More Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Tags

Products


Release

R2008b

Community Treasure Hunt

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

Start Hunting!