Error executing shell-script commands in Matlab
8 views (last 30 days)
Show older comments
I am trying to run a .sh 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
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
1 Comment
Guillermo Camacho
on 1 Aug 2022
Did you solve it?
Same type of problem while executing a PDAL command from matlab in Ubuntu 19.04
command =
'pdal translate ~/Documents/boxesDatabaseSample/corrida1/"Depth Long Throw"/132696437677359737.ply frame1.ply --writers.ply.dims="X=float32,Y=float32,Z=float32"'
K>> system(command)
pdal: /usr/local/MATLAB/R2021b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/local/lib/libgdal.so.30)
ans =
0
Answers (1)
Himanshu
on 24 Oct 2024 at 6:26
Edited: Himanshu
on 24 Oct 2024 at 6:27
Hey,
The errors mentioned anobe indicates conflicts between MATLAB and the system libraries used by gnuplot. MATLAB ships with its own version of certain libraries, which can conflict with the versions required by other software like gnuplot.
You can try the folloiwng things to resolve these errors:
- You can try preventing MATLAB's libraries from interfering. You can try running the script in a subshell that doesn't inherit the MATLAB environment.
system('bash -c "path_to_file/file.sh"');
- You can temporarily modify the LD_LIBRARY_PATH environment variable within your script to exclude MATLAB's library paths.
# Inside file.sh
export OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib # Add other paths as needed
gnuplot your_script.gnuplot
export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
- If the use of gnuplot is not strictly necessary, consider using MATLAB's native plotting capabilities, which might avoid these library conflicts altogether.
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!