-1

I am trying to call a Python function from MATLAB, and I'm getting a permission denied error.

function [success] = run python()
%system('sudo easy_install requests');
%system('sudo easy_install PyCrypto');
system('/Users/mmk/Desktop/Folder/run.py')

success = 1;

end

The error is:

/bin/bash: /Users/mmk/Desktop/Folder/run.py: Permission denied

ans =

    1 

Not sure what I should be doing in this case. Any ideas?

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
mmk88
  • 91
  • 1
  • 6

1 Answers1

0

figured it out.

it needs to be system('python /Users/mmk/Desktop/Folder/run.py')

mmk88
  • 91
  • 1
  • 6
  • Alternatively, if your python file is executable (google chmod), and you make the first line of the file `#!/usr/bin/env python` your previous approach should have worked, too. – Tom Nov 25 '15 at 08:10