Search code examples
matlabmatlab-compilermcc

No command MCC found


I am trying to create an executable using Matlab 2013a in Ubuntu 14.04, and after some research, I understood the following command, creates the executable

    mcc -mv matlabfile.m

However, when I run this command, I get following error

    No command 'mcc' found, but there are 33 similar ones
    mcc: command not found

Is this an error due to Matlab installation or should I include the compiler into any path variable, so that I can access it using the command mcc.? How do I solve this?

UPDATE 1

I ran the ver command in my matlab and am showing the partial output, just to prove it includes Maltab Compiler.

    Image Processing Toolbox                              Version 8.2            (R2013a)
    Instrument Control Toolbox                            Version 3.3        (R2013a)
    MATLAB Builder JA                                     Version 2.2.6      (R2013a)
    MATLAB Coder                                          Version 2.4        (R2013a)
    MATLAB Compiler                                       Version  4.18.1     (R2013a)
    MATLAB Distributed Computing Server                   Version 6.2        (R2013a)
    MATLAB Report Generator                               Version 3.14       (R2013a)
    Mapping Toolbox                                       Version 3.7        (R2013a)
    Model Predictive Control Toolbo

Solution

  • If you have the Matlab Compiler toolbox installed, you can either run the mcc.m function through the Matlab command line:

    mcc -mv matlabfile.m
    

    Or you can run the mcc binary directly in your shell:

    /path/to/matlab/bin/mcc -mv matlabfile.m
    

    Or you can add the folder containing the mcc binary to you PATH and then run it:

    PATH="$PATH:/path/to/matlab/bin/"
    mcc -mv matlabfile.m