- Replace the occurrences of the now deprecated ‘mexSetTrapFlag’ with ‘mexCallMATLABWithTrap’ in all files in the project, and not just ‘svm_struct_api.c’ file.
- MATLAB provides compatibility flags that can help run older code on newer versions. Try using the -compatibleArrayDims flag when compiling the MEX file. Refer to the command below:
error while try to comply a c code into matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
hello
I am a Phd student at the Technion, Israel.
as part of my research I am trying to implement structural svm learining algorithm on datasets collected in laboratory experiments.
I downloaded a code from github that implement struct svm learning in this link (the packege is attached)
while trying to run it on matlab I recieved this error:
"Error using mex
Deprecated MEX function mexSetTrapFlag was called. Update the source code to use mexCallMATLABWithTrap.
Error in makefile_windows (line 14)
mex -largeArrayDims -c -DWIN ./svm_struct_api.c"
To resolve it i went into the "svm_struct_api.c" file and changed all the mexCallMATLAB functions into mexCallMATLABWithTrap and i still receive the same error
any help in resolving this
댓글 수: 0
답변 (1개)
Karanjot
2023년 10월 6일
Hi Noam,
I understand that you would like to resolve the following error in your MATLAB code:
"Error using mex
Deprecated MEX function mexSetTrapFlag was called. Update the source code to use mexCallMATLABWithTrap.
Error in makefile_windows (line 14)
mex -largeArrayDims -c -DWIN ./svm_struct_api.c"
In releases post MATLAB R2018a, ‘mexSetTrapFlag’ has been removed. The ‘mexCallMATLABWithTrap’ function, similar to ‘mexCallMATLAB’, lets you call MATLAB functions from within a MEX file. In addition, mexCallMATLABWithTrap’ lets you catch (trap) errors. I recommend trying the following:
mex -compatibleArrayDims -largeArrayDims -c -DWIN ./svm_struct_api.c
To learn more about this, please refer to the below documentation:
I hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!