Why do I receive an error message - 'Specified key not found in container' - when running a MATLAB function after generating code for it using MATLAB Coder?

7 ビュー (過去 30 日間)
I am generating code for a MATLAB script using MATLAB Coder and this generates a MEX file. I find that the code generation is successful, but when I go back to run the script, I receive an error that says - 'Specified key not found in container'. Why does this happen?
 

採用された回答

MathWorks Support Team
MathWorks Support Team 2016 年 9 月 23 日
This error occurred due to the incorrect compilation of the MEX file. In this case, because the original '.M' function was shadowed by the corresponding MEX file, calling the function resulted in the execution of the MEX file and led to the observed error. To resolve the error, perform the following steps:
1. Enter the following command in the Command window to locate the MEX file:
              which -all <mexfilename>.<mexfile-extension>
              NOTE - The <mexfile-extension> can be obtained by entering the "mexext" command at the MATLAB Command Window.
2.  This command will output the path to the MEX file if it still exists. Navigate to the location of the MEX file and delete it.
3.  Restart MATLAB and try running the function again. An alternative to restarting MATLAB would be to enter the command - 'clear mex' at the Command Window and then try running the function again. 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by