Azzera filtri
Azzera filtri

How do I get the MATLAB current directory in mex code?

2 visualizzazioni (ultimi 30 giorni)
Roland
Roland il 30 Gen 2015
Modificato: Jan il 30 Gen 2015
In matlab it would be pwd, but in mex code, how would I find out?

Risposte (1)

Jan
Jan il 30 Gen 2015
Modificato: Jan il 30 Gen 2015
The current folder inside the MEX file is the same as in Matlab. So you can use the standard C command getcwd to obtain the current directory. A modern version is _getcwd or if you are using the boost libs: current_path(). Under Windows the GetCurrentDirectory is sufficient also and can handle Unicode filenames in addition, but is depends on the platform.

Categorie

Scopri di più su Write C Functions Callable from MATLAB (MEX Files) in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by