inputParser not supported by MATLAB Coder

1 次查看(过去 30 天)
I started to get into the habit of using inputParser to manage construction options to MATLAB classes I create. It just seems like the cleanest, most future-proof way to go about doing it. Now, I just hit a very annoying brick wall. I wanted to run one of these through MATLAB Coder to make a C++ version to at least serve as a template for a bit of production code. BOOM! MATLAB Coder doesn't like functions/classes that use inputParser. Is there anyone who's found a good workaround?

采纳的回答

David Fink
David Fink 2024-7-15
Many of the use cases handled by inputParser are now supported by the arguments block, which supports code generation.
This modern syntax includes support for required, optional, repeating, and named arguments, argument validation, and default values.
  2 个评论
Martin Ryba
Martin Ryba 2024-7-15
Ah, OK. So, yet another method to do something that I need to learn. I wish the documentation for inputParser indicated that it is effectively deprecated and that this is the "right" way to do it.
Matt J
Matt J 2024-7-15
编辑:Matt J 2024-7-15
inputParser can't be deprecated, because it has functionality that is still not supported by the newer framework, e.g., StructExpand.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Manage Products 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by