Current Directory for Generated Code

7 Ansichten (letzte 30 Tage)
Michael
Michael am 22 Jun. 2022
Bearbeitet: Walter Roberson am 3 Okt. 2023
pwd Doesn't seem to be supported for code generation. How might one get the current directory when deploying code with code generator?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 22 Jun. 2022
Bearbeitet: Walter Roberson am 3 Okt. 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 Kommentar
Michael
Michael am 5 Nov. 2022
The code for using the getcwd() C function within coder.ceval() can be found in this answer .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Michael
Michael am 3 Okt. 2023
pwd is now supported for code generation for R2023b.

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by