Hello,
I am using someone else's toolbox in MATLAB, which contains .mexmaci64 files. I downloaded it from the internet on my computer (Mac OS Big Sur, fully updated). When I try to use these files though, I get the following error message (from Finder):
"findwithinMEX.mexmaci64” cannot be opened because it is from an unidentified developer." macOS cannot verify that this app is free from malware."
If I go into System Preferences and allow MATLAB too open the file anyways, I get the following error from MATLAB:
Error using open (line 136)
Cannot edit the MEX-file
I think that it's likely that I haven't set up MEX files correctly in MATLAB. But I wanted to see if anyone else has any guidance about how to do so. Thank you.

댓글 수: 2

Maria Giulia Preti
Maria Giulia Preti 2021년 2월 25일
I have the same problem. The solution below didn't work. Did you find a solution?
Samuel L. Polk
Samuel L. Polk 2021년 2월 25일
Walter's solution worked well for me.

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

 채택된 답변

Walter Roberson
Walter Roberson 2020년 12월 5일
편집: Walter Roberson 2021년 2월 25일

0 개 추천

You tried to double click the file in Finder to open it.
mex files are not source code. You need special tools to examine their content, such as otool https://www.unix.com/man-page/osx/1/otool/
They are not encrypted or anything like that: they are a structured binary file that contains machine code ready to be loaded into memory and executed by the CPU.
To use them from MATLAB you make sure that the file is along your MATLAB path and then you just call the function, passing appropriate arguments in, just as if it were a MATLAB function

댓글 수: 4

Bill Tubbs
Bill Tubbs 2021년 8월 18일
편집: Bill Tubbs 2021년 8월 18일
I have the same problem but I did not double-click the MEX file. I am trying to run the original developers example script and the mex file is on the path:
>> help jm_fit_mex
jm_fit_mex is a MEX-file.
When I run the example .m file an Mac OS pop-up window appears:
and MATLAB raises this error message when I press the cancel button:
Invalid MEX-file
'/Users/billtubbs/disturb-models/bemporad-2018/jump_models/functions/jm_fit_mex.mexmaci64':
dlopen(/Users/billtubbs/disturb-models/bemporad-2018/jump_models/functions/jm_fit_mex.mexmaci64,
6): no suitable image found. Did find:
/Users/billtubbs/disturb-models/bemporad-2018/jump_models/functions/jm_fit_mex.mexmaci64:
code signature in
(/Users/billtubbs/disturb-models/bemporad-2018/jump_models/functions/jm_fit_mex.mexmaci64)
not valid for use in process using Library Validation: library load disallowed by system
policy
Bill Tubbs
Bill Tubbs 2021년 8월 18일
편집: Bill Tubbs 2021년 8월 18일
I tried 'move to trash' and this did not solve the problem. Presumably the developer has not provided the source code for this component or it would be automatically re-built?
Bill Tubbs
Bill Tubbs 2021년 8월 18일
편집: Bill Tubbs 2021년 8월 18일
Okay, with a bit of sleuthing I realised that the developer has provided matlab function scripts for all the mex functions so all I needed to do was go through the code and change the function calls from jm_fit_mex to jm_fit etc. and it runs now (albeit probably slower than with the MEX files).
Still, does anyone know how to 'approve' a MEX file on Mac OS X so that I can take the risk and use it?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by