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

Réponses (1)

Jan
Jan le 30 Jan 2015
Modifié(e) : Jan le 30 Jan 2015

1 vote

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.

Catégories

En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange

Tags

Question posée :

le 30 Jan 2015

Modifié(e) :

Jan
le 30 Jan 2015

Community Treasure Hunt

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

Start Hunting!

Translated by