Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1ca724

Browse files
committed
Merge pull request #183 from auneri/master
Respect current directory when starting MATLAB on Windows
2 parents 54eea07 + 01245ec commit b1ca724

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pymatbridge/pymatbridge.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ def _preamble_code(self):
176176
# suppress warnings while loading the path, in the case of
177177
# overshadowing a built-in function on a newer version of
178178
# Matlab (e.g. isrow)
179-
return ["old_warning_state = warning('off','all')",
180-
"addpath(genpath('%s'))" % MATLAB_FOLDER,
181-
"warning(old_warning_state)",
182-
"clear old_warning_state"]
179+
return ["old_warning_state = warning('off','all');",
180+
"addpath(genpath('%s'));" % MATLAB_FOLDER,
181+
"warning(old_warning_state);",
182+
"clear('old_warning_state');",
183+
"cd('%s');" % os.getcwd()]
183184

184185
def _execute_flag(self): # pragma: no cover
185186
raise NotImplemented

0 commit comments

Comments
 (0)