Current Directory for Generated Code

8 vues (au cours des 30 derniers jours)
Michael le 22 Juin 2022
pwd Doesn't seem to be supported for code generation. How might one get the current directory when deploying code with code generator?

Réponse acceptée

Walter Roberson
Walter Roberson le 22 Juin 2022
Modifié(e) : Walter Roberson le 3 Oct 2023
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 commentaire
Michael le 5 Nov 2022
The code for using the getcwd() C function within coder.ceval() can be found in this answer .

Connectez-vous pour commenter.

Plus de réponses (1)

Michael le 3 Oct 2023
pwd is now supported for code generation for R2023b.


En savoir plus sur MATLAB Coder dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by