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

2 次查看(过去 30 天)
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.

采纳的回答

MathWorks Support Team
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品


版本

R2008b

Community Treasure Hunt

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

Start Hunting!

Translated by