Current Directory for Generated Code

pwd Doesn't seem to be supported for code generation. How might one get the current directory when deploying code with code generator?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Jun. de 2022
Editada: Walter Roberson el 3 de Oct. de 2023

0 votos

MATLAB Coder is designed to target embedded systems, so functionality that is not part of the C Standard Library is often not available. DSP and so on often have no file system.
If you are targeting MacOS or Linux then coder.ceval to the appropriate system call. Windows uses a different system call.

1 comentario

Michael
Michael el 5 de Nov. de 2022
The code for using the getcwd() C function within coder.ceval() can be found in this answer .

Iniciar sesión para comentar.

Más respuestas (1)

Michael
Michael el 3 de Oct. de 2023

2 votos

pwd is now supported for code generation for R2023b.

Productos

Versión

R2022a

Etiquetas

Preguntada:

el 22 de Jun. de 2022

Editada:

el 3 de Oct. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by