MATLAB: Do I receive a “command not found” error when I try to run the executable generated by MATLAB Compiler
MATLAB Compiler
I tried to execute my program:
!hello
However, I received the following error:
/bin/bash: line 1: hello: command not found
Using LS or DIR I can see that the hello executable is present in the current directory.
Best Answer
Many UNIX systems are not setup to execute applications that are in your current working directory. To work around this, you can add "." to your PATH environment variable or do the following:
It is not possible to directly run the compiled executable on Maci 64 systems. Instead you must run it using the Application bundle that is created automatically by the MATLAB Compiler.
Another way to execute the compiled application is to use the run_ApplicationName.sh script that is generated by the MATLAB Compiler.
This script takes the Path to Installation directory of the MCR/MATLAB as the input and executes the application (example) as shown below:
!./run_example.sh $MATLABROOT$
where $MATLABROOT$ can be found by typing matlabroot at the MATLAB command prompt. If MATLAB is not installed on the machine, use the root directory of the MCRInstaller.
You can also directly invoke the application from within the Application bundle by using the following command:
This has been verified as a bug in MATLAB Compiler 3.0 (R13) in the way that LCC compiler handles compiling C stand-alone applications. This problem is specific to the LCC compiler. There are currently no known workarounds if you want to use the LCC compiler.
Use Microsoft Visual C++ 6.0 compiler or any other supported compiler as mentioned in the technical note at the following URL:
Best Answer