Error recovery (try/catch) for Code Generation

What is the best way to implement error handling for Matlab code that I plan to deploy to C/C++ so that my code doesn't crash if there is an error that I might be able to recover from? I can see that we can do error reporting in generated code, so at least if there is an error I'll know what happened. But if try/catch isn't complatible with code generation the function will just crash if there is an error. Is there some way to recover from errors in generated code?

5 件のコメント

Raghu Boggavarapu
Raghu Boggavarapu 2022 年 8 月 22 日
Error exception handling is unfortunately not supported in MATLAB Coder as of MATLAB R2022a. We've made an internal note of your request so we can look at lifting that limitation in the future.
Michael
Michael 2022 年 8 月 22 日
Okay. Thanks. That would be really helpful for writing robust code.
Sri Raman A
Sri Raman A 2023 年 4 月 11 日
Its not yet supported in 2023a also. Any hope we can expect this feature in 2023b?
Tilman
Tilman 2023 年 5 月 22 日
編集済み: Tilman 2023 年 5 月 22 日
@Raghu Boggavarapu thank you, this would be really helpful in order to be able to build a standalone from Matlab.
jessupj
jessupj 2024 年 3 月 28 日
I don't see it in R2023b either. any change it will be in 24a? For applying things to real-world data that's a mess and sufficient preprocessing/data cleaning is intractible, it sure would be nice to have.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Coder についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 6 月 2 日

コメント済み:

2024 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by