Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Matlab compiler usage

Prerequisites

UNIX/LINUX

You will need on your system at least :

  • MATLAB
  • the MATLAB Compiler Toolbox of the same version than the MATLAB one (=v4.10 if MATLAB is v4.10)
  • a compatible version of gcc (>=4.0.0 for a MATLAB Compiler v4.10)

Other systems

We do not need to run it on other systems, and so we did not test it.

Building an executable

Here is describe how to build an stand-alone executable from MATLAB sources using the MATLAB Compiler toolbox.

Synopsis

To build the application, just use the MATLAB compiler command

mcc -mv <app>.m

Notes :

  • For an application composed of multiple sources files, run the “mcc” command with the ONLY the main script as argument. The compiler will automatically detect and import all required dependencies.
  • For running your build, you will need to have the same version of the mcc Compiler and of the MCR Runtime

Example

  • Consider the following source :
    sinc_graphic.m
sz  = 10;
dsz = 0.25;
 
[ X, Y ] = meshgrid( -sz:dsz:sz, -sz:dsz:sz );
R = sqrt( X.^2 + Y.^2 );
Z = sin ( R ) ./ R;
 
% Display the result of the cardinal sine as a Surface Plot
surf ( X,Y,Z );
  • To build the application, use the command
mcc -mv sinc_graphic.m
  • This will produce the files :

    mccExcludedFiles.log
    sinc_graphic_main.c
    sinc_graphic_mcc_component_data.c
    sinc_graphic.prj

    readme.txt
    run_sinc_graphic.sh
    sinc_graphic


Only the 2 last ones are requested for the deployment. However, the readme.txt contains useful informations on how to run the application previously built.

Deployment

For running the build, you first need to install the “Matlab Compiler Runtime” environment (MCR). This application will be able to execute your build.

Matlab Compiler Runtime Installation

  • Locate the file “MCRInstaller.bin” which is situed in the MATLAB Compiler Toolbox directory.
  • Execute it. During the installation, it will be asked you to choose a target directory. In the following, we will call it ${MCR_ROOT}.

Application Installation

In the installation directory, just copy the files created during the build process :
readme.txt
run_<app>.sh
<app>

where :
<app> is the name of your main script, with the “.m” extension omitted

Example

On the Icare’s system, we proceed this way :

  • MATLAB has been installed in /usr/local/matlab, the toolbox directory is /usr/local/matlab/toolbox/ and the compiler one is in /usr/local/matlab/toolbox/compiler
  • So the Runtime Installer is situed in /usr/local/matlab/toolbox/compiler/deploy/glnx86/MCRInstaller.bin
  • It has been installed in ${HOME}/lib/MATLAB_Compiler_Runtime. This is our ${MCR_ROOT}.
  • The “sinc_graphic” application above has been deployed in ${HOME}/test by filling it with the files :

run_sinc_graphic.sh
sinc_graphic

Execution

Synopsis

Finally, to run the application,

  • Go in the installation directory,
  • Run the “.sh” file by typing
./run_<app>.sh ${MCR_ROOT}/<vXXX> <args>

where :

<app> is the name of your main script, with the “.m” extension omitted
<args> are the usual command line arguments
<vXXX> is the version of the compiler runtime to use

Example

  • Go in the directory ${HOME}/test
        cd ${HOME}/test
  • Launch the application
        ./run_sinc_graphic.sh ${MCR_ROOT}/v710/
  • You should obtain the widget

Surface Plot of a Cardinal Sine

More news

Tutorials

Reading a NetCDF file with Python, Matlab and R

Language/Format: MATLAB
Description: This page gives pieces of code to read data in a NetCDF file
Author(s): Aminata NDIAYE (ICARE)

10.10.2024

Highlights

AERIS/ICARE was migrated his good old FTP server to SFTP

For security reason, we are abandoning the FTP protocol in favor of SFTP on our distribution server. Depending of the way you are using this service, you can have to change the commands you are used to. Note that not all applications support the SFTP protocol, and some additional tools may need to be installed […]

01.03.2024

Tutorials

How to convert a matplotlib figure to a numpy array or a PIL image

Language/Format: Python
Description: For manipulating a figure build with matplotlib, it is sometimes requested to convert it in a format understandable by other python libraries. This can be useful for using scipy image filters or manually adding annotations for example.
This page details how to convert a matplotlib figure to a numpy 3D array of RGBA values, or directly to a PIL ( Python Imaging Library ) Image.
Author(s): Nicolas Pascal (ICARE)

10.02.2017

Search