Error executing shell-script commands in Matlab

조회 수: 6 (최근 30일)
Yro
Yro 2019년 10월 15일
편집: Himanshu 2024년 10월 24일
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
Guillermo Camacho
Guillermo Camacho 2022년 8월 1일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Himanshu
Himanshu 2024년 10월 24일
편집: Himanshu 2024년 10월 24일
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.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by