th3g3ntl3man
th3g3ntl3man

Reputation: 2106

Run matlab command in terminal

I tried to launch this matlab command on terminal to get the path where are located the external library:

your_path = [matlabroot '/extern/include'];

I use this the following command for launch the command:

matlab -nodisplay -nosplash -nodesktop 'command'

but I have this error:

bad pattern: [matlabroot

Upvotes: 0

Views: 225

Answers (1)

Andrew Janke
Andrew Janke

Reputation: 23858

You need to run that [matlabroomt '/extern/include'] statement inside your Matlab code, not directly on the shell command line. Make sure you get your quotes right!

matlab -batch 'disp([matlabroot ''/extern/include''])'

Then you can capture it in a shell variable if you want to use it in something else:

mat_include_path=$(matlab -batch 'disp([matlabroot ''/extern/include''])')

Upvotes: 2

Related Questions