{"action":"opened","issue":{"url":"https://api.github.com/repos/mrkrd/matlab_wrapper/issues/9","labels_url":"https://api.github.com/repos/mrkrd/matlab_wrapper/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/mrkrd/matlab_wrapper/issues/9/comments","events_url":"https://api.github.com/repos/mrkrd/matlab_wrapper/issues/9/events","html_url":"https://github.com/mrkrd/matlab_wrapper/issues/9","id":65442151,"number":9,"title":"path for functions outside current directory","user":{"login":"huguesfontenelle","id":6872108,"avatar_url":"https://avatars.githubusercontent.com/u/6872108?v=3","gravatar_id":"","url":"https://api.github.com/users/huguesfontenelle","html_url":"https://github.com/huguesfontenelle","followers_url":"https://api.github.com/users/huguesfontenelle/followers","following_url":"https://api.github.com/users/huguesfontenelle/following{/other_user}","gists_url":"https://api.github.com/users/huguesfontenelle/gists{/gist_id}","starred_url":"https://api.github.com/users/huguesfontenelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huguesfontenelle/subscriptions","organizations_url":"https://api.github.com/users/huguesfontenelle/orgs","repos_url":"https://api.github.com/users/huguesfontenelle/repos","events_url":"https://api.github.com/users/huguesfontenelle/events{/privacy}","received_events_url":"https://api.github.com/users/huguesfontenelle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-31T12:46:06Z","updated_at":"2015-03-31T12:46:06Z","closed_at":null,"body":"It seems that I must start python in the same directory where the *.m files are.\r\n\r\nFor example:\r\n```\r\nimport matlab_wrapper\r\nmatlab = matlab_wrapper.MatlabSession()\r\nmatlab.eval('my_script.m')\r\n```\r\nworks well when `my_script.m` is in the current dir.\r\n\r\nIf I start `python` or `ipython` one directory up, I get:\r\n```\r\nRuntimeError: Error from MATLAB\r\nMATLAB:undefinedVarOrFunction: Undefined variable \"my_script\" or function \"my_script.m\".\r\n```\r\n\r\nI thought about a couple of workarounds:\r\n```\r\nimport os\r\nos.chdir('examples')\r\n```\r\n\r\nor\r\n```\r\nmatlab.eval('addpath(\"\\path\\to\\code\\examples\");')\r\n```\r\n\r\nbut neither work on my MacOS 10.9.5, Matlab R2013b 64bits, Python 2.7.9, iPython 3.0.0"}}