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

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 comentarios

We are working on supporting argument blocks in MATLAB Coder.
Can you please attach some examples of how would you use it, what types, sizes etc your inputs would have. This would help us make sure the feature works for you. If you don't want to publish your code here, please contact the MathWorks technical support and ask them to pass your example to MATLAB Coder team. Thanks!
Thank you for your reply, I have such an idea at the moment, but I don't have a clear example to show you yet, because there are more cases to consider, and this new syntax is compatible with the previous syntax like coder.typeof.
Incidentally, is the theme "generate only one c file" sure to appear in the next version of R2022b? @Denis Gurchenkov
Incidentally, is the theme "generate only one c file" sure to appear in the next version of R2022b?
In general we do not comment on future plans.
Respect your opinion@Steven Lord,go for it, dev team, and hopefully we'll see the desired features!
An example I just tried to use:
function [a, b, c, d, e]=myfun(find_file)
arguments
find_file (1,1) logical = true
end
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.

Iniciar sesión para comentar.

 Respuesta aceptada

xingxingcui
xingxingcui el 10 de Oct. de 2022
Editada: xingxingcui el 27 de Abr. de 2024
It is good to hear that this syntax supports C/C++ code generation since R2022b .
-------------------------Off-topic interlude, 2024-------------------------------
I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China,or a remote support position. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!
Email: cuixingxing150@gmail.com

2 comentarios

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:
@Matan Silver Thanks to you guys for adding timely comment annotations, R2023b is getting more and more compliant with the human touch!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.

Productos

Versión

R2022a

Preguntada:

el 16 de Mzo. de 2022

Editada:

el 27 de Abr. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by