"arguments ... end" syntax input argument validation module group supports C code generation?

5 views (last 30 days)
The latest version of Matlab Coder does not seem to support the use of "arguments...end" module in functions. If so, I don't have to specify the type and size of each input argument before calling the "codegen" function?
I hope this will be enhanced in future versions!
-------2022.3.24 update--------
try/catch shoud also support C code generation.
  6 Comments
Gregory Warnes
Gregory Warnes on 7 May 2022
An example I just tried to use:
function [a, b, c, d, e]=myfun(find_file)
arguments
find_file (1,1) logical = true
end
Richard McCormack
Richard McCormack on 10 May 2022
Thank you for the example, Gregory! Please keep an eye out for future releases of MATLAB Coder, we hope to get this feature to you soon.

Sign in to comment.

Accepted Answer

cui,xingxing
cui,xingxing on 10 Oct 2022
It is good to hear that this syntax supports C/C++ code generation since R2022b .
  2 Comments
Matan Silver
Matan Silver on 26 Sep 2023
Just an update for future readers: In addition to supporting the arguments block in general for code generation (R2022b), starting in R2023b there is now support for omitting "-args" if you have a fully specified arguments block:
cui,xingxing
cui,xingxing on 27 Sep 2023
@Matan Silver Thanks to you guys for adding timely comment annotations, R2023b is getting more and more compliant with the human touch!

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!