Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] run_matlab_cmd now working with MATLAB on Linux #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmbannert
Copy link

Hi Matthias,

I tried to run your demo code but the MATLAB call failed in mit.py at lines 119-125, saying that it couldn't find extract_all_fixations:

print('Running original code to extract fixations. This can take some minutes.')
print('Warning: In the IPython Notebook, the output is shown on the console instead of the notebook.')
with open(os.path.join(temp_dir, 'extract_all_fixations.m'), 'w') as f:
    for cmd in cmds:
        f.write('{}\n'.format(cmd))

run_matlab_cmd('extract_all_fixations;', cwd=temp_dir)

The problem is that, when running MATLAB on Linux, the cwd argument often has no effect when running the MATLAB command via subprocess.check_call in utils.py. This is because the startup folder of MATLAB on Linux is not always the directory from which you start it (see here for more information). So what most likely happened was that it started MATLAB from the temporary folder but it then used a different folder as a startup folder. And that folder did not contain the extract_all_fixations.m file.

I modified run_matlab_cmd so that MATLAB first cd's into the directory that contains the m file and then executes the desired function. The demo code now runs as expected.

Cheers,
Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant