1

I am trying to run a shell-script file in Matlab and I get errors of which I have no idea. I am using the system command as follows:

system('sh path_to_file/file.sh') ;

I tried changing permissions

chmod -R 755 file

and I still can't execute the file. The file runs successfully outside the Matlab script. I am running Matlab on Ubuntu 18.04. I hope you can help me, thanks in advance.

Errors:

gnuplot: /home/user/Matlab2019a/bin/glnxa64/libQt5Network.so.5: no version information available (required by gnuplot)
gnuplot: /home/user/Matlab2019a/bin/glnxa64/libQt5Core.so.5: no version information available (required by gnuplot)
gnuplot: /home/user/Matlab2019a/bin/glnxa64/libQt5Core.so.5: no version information available (required by gnuplot)
gnuplot: /home/user/Matlab2019a/bin/glnxa64/libQt5Gui.so.5: no version information available (required by gnuplot)
gnuplot: /home/user/Matlab2019a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
gnuplot: /home/user/Matlab2019a/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0)
gnuplot: relocation error: gnuplot: symbol qt_version_tag version Qt_5.9 not defined in file libQt5Core.so.5 with link time reference
3
  • What does which sed return? Commented Oct 15, 2019 at 8:29
  • Thanks for your reply, I could run the file, but I still don't solve the errors with gnuplot. Commented Oct 15, 2019 at 8:40
  • Do you have necessary environment variables in .bashrc or somewhere? matlab may be unaware of them Commented Oct 15, 2019 at 9:38

1 Answer 1

1

Obviously you cannot run gnuplot using MATLAB's shell environment, as paths point to MATLAB's versions of libraries instead of the system's versions. So you need to make sure that the environment is reset.

One way to do this is using env:

system('env -i sh path_to_file/file.sh')

But sh doesn't read .bashrc, if you set up relevant environment for gnuplot there (not sure this is the case) then you should use bash instead of sh.

Sign up to request clarification or add additional context in comments.

5 Comments

HI, thanks for your replay. thanks for your response, with the command I could execute gnuplot but now I get the following matlab error: License checkout failed. License Manager Error -9 Your username does not match the username in the license file. To run on this computer, you must run the Activation client to reactivate your license
@Yro: When do you see this message? When running the system command? If so, what is the contents of file.sh? Do you start MATLAB in that file?
Yes, when I execute the system command. I am running Matlab from that file also in batch mode. I see another error, for which the file is not executed: Unable to init server: Could not connect: Connection refused and (eog:22394): Gtk-WARNING **: 16:54:00.490: cannot open display:
@Yro: Running MATLAB from within MATLAB sounds like a bad idea... In any case, you have some configuration file that sets up information that lets MATLAB find the license file. You need to make sure this one is loaded. If you used .bashrc, use bash instead of sh in your shell command. If this configuration is elsewhere, tell bash which configuration files to load (maybe adding the --login option, see here). Maybe your regular shell is csh? Then use that instead of sh. Basically, using sh is wrong for you because it doesn't load configuration.
I could solve using the setenv command in Matlab-setenv('LD_LIBRARY_PATH','/usr/lib')- . Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.