Error executing shell-script commands in Matlab

8 vues (au cours des 30 derniers jours)
Yro
Yro le 15 Oct 2019
Modifié(e) : Himanshu le 24 Oct 2024 à 6:27
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 commentaire
Guillermo Camacho
Guillermo Camacho le 1 Août 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

Connectez-vous pour commenter.

Réponses (1)

Himanshu
Himanshu le 24 Oct 2024 à 6:26
Modifié(e) : Himanshu le 24 Oct 2024 à 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.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by