简体   繁体   中英

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

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''])')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM