2

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
Lakshmi Narayanan
  • 5,220
  • 13
  • 50
  • 92
  • See: [https://www.mathworks.com/matlabcentral/answers/9433-mcc-command](https://www.mathworks.com/matlabcentral/answers/9433-mcc-command) – Rotem Sep 23 '16 at 08:25
  • I did come across this link. I think he's saying for windows, that his compiler might be missing. I can find my compiler in my matlab, in ubuntu, in my Matlab. Is there anything am missing? – Lakshmi Narayanan Sep 23 '16 at 09:32
  • Do you own a copy of the of the Matlab Compiler toolbox? – drhagen Sep 23 '16 at 09:56
  • Can you please tell me how I can verify that? if I open Maltab and Apps tab, I can find a button saying Matlab compiler, which is allowing me to choose a main program and its dependencies. – Lakshmi Narayanan Sep 23 '16 at 09:59
  • That apps tab should be fine. To be sure, run the `ver` command, which prints out all the toolboxes you own. – drhagen Sep 23 '16 at 10:03
  • I did, and found Matlab compiler there. have updated my question – Lakshmi Narayanan Sep 23 '16 at 10:09
  • has it got something to do with ubuntu's libraries understanding MCC as a command? – Lakshmi Narayanan Sep 23 '16 at 10:12

1 Answers1

2

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
drhagen
  • 8,331
  • 8
  • 53
  • 82