Skip to end of metadata
Go to start of metadata

You can run shell commands directly from matlab using the "!" follwed by any standard shell command, or by running the function "system", which gives greater control of what you run and how you get the output.

Common usage is:

[status,result] = system('command')

and if you want to inject matlab variables into the command, nest an "sprintf" command in there system(sprintf(...))

 

This worked fine on earlier versions of matlab for me, but in the latest 2017 version, it started to fail with comma/snark utils due to a change in LD_LIBRARY_PATH.

By default, matlab might change this path when it loads, causing comma/snark commands to fail

 

The solution is here:

https://au.mathworks.com/matlabcentral/newsreader/view_thread/162466

Specifically, edit the LDPATH_PREFIX variable in matlab/bin/.matlab7rc.sh, for your specific architecture 'case'

 

For me this was under the case:

'glnx*'

and I set

LDPATH_PREFIX='/usr/lib/x86_64-linux-gnu/'

I found that by running ldd on one of our utilities.

Reload matlab, all good now

  • No labels