Invalid MEX-file in Matlab Online

조회 수: 2 (최근 30일)
Po-Chun
Po-Chun 2022년 12월 28일
댓글: Divyam 2025년 1월 2일
Hi,
I am tring to run a code in Matlab Online recently:
However, when I extracted the files and ran the examples, it always said
"Invalid MEX-file '/MATLAB Drive/Release2/MCmatlab-Release/+MCmatlab/@model/private/MCmatlab.mexa64':
/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /MATLAB
Drive/Release2/MCmatlab-Release/+MCmatlab/@model/private/MCmatlab.mexa64)".
I found solutions like
But I cannot find a place like CMD or shell in the cloud environment to do the job.
Is there any way to install or link to the library?
Many thanks.

답변 (1개)

Divyam
Divyam 2025년 1월 2일
편집: Divyam 2025년 1월 2일
You can run external commands in MATLAB by using the "!" character as a shell escape character in the MATLAB command line. You can also use the "system" function to run system level commands for your operating system.
!mkdir newdir
system('mkdir newdir')
For more information regarding the use of "!" to run external commands, refer to this documentation: https://www.mathworks.com/help/matlab/matlab_external/run-external-commands-scripts-and-programs.html
For more information regarding the "system" function, refer to this documentation: https://www.mathworks.com/help/matlab/ref/system.html
  댓글 수: 2
Walter Roberson
Walter Roberson 2025년 1월 2일
You would not use system() to execute a .mex* file. .mex* files are designed to be called directly from MATLAB.
Divyam
Divyam 2025년 1월 2일

The system() function is not used for the mex files but for the system commands mentioned in the MATLAB answers in the question.

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

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by