Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book
Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book
Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book
Ebook184 pages1 hour

Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Nowadays, many of the tools and applications used in the biomedical field are developed in MATLAB (The MathWorks, Inc., MA, USA). However, the C++ code is license-free so better suits the policy of code distributed in the form of Open Source. To facilitate the conversion from MATLAB to C++, MATLAB developers have recently created a toolbox called MATLAB Coder containing various functions and tools to facilitate a (semi-) automatic code conversion. In this book, using significant examples of increasing complexity, we show how to quickly and easily exploit the MATLAB Coder to create ".lib" static libraries, ".exe" executables and ".cpp" source code starting from MATLAB ".m" functions.

SINOSSI

Al giorno d'oggi, molti dei tools ed applicativi utilizzati in campo biomedicale sono sviluppati in linguaggio MATLAB (The MathWorks, Inc., MA, USA). Tuttavia, il codice C++ non essendo collegato a licenze di utilizzo meglio si adatta alla politica di codice distribuito in forma di Open Source. Per facilitare la conversione dal linguaggio MATLAB al linguaggio C++, gli sviluppatori MATLAB hanno recentemente realizzato un toolbox chiamato MATLAB Coder contenente varie funzioni e strumenti per facilitare la conversione (semi-)automatica del codice. In questo libro, utilizzando esempi significativi di complessità crescente, mostriamo come sfruttare in maniera facile e veloce il MATLAB Coder per realizzare librerie statiche ".lib", eseguibili ".exe" e codice sorgente ".cpp" partendo da funzioni MATLAB ".m".
LanguageEnglish
PublisherYoucanprint
Release dateJun 21, 2021
ISBN9791220344005
Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book

Related to Guide for Dummies

Related ebooks

Programming For You

View More

Related articles

Reviews for Guide for Dummies

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Guide for Dummies - Filippo Piccinini

    Abstract (English version)

    Nowadays, many of the tools and applications used in the biomedical field are developed in MATLAB (The MathWorks, Inc., MA, USA). However, C++ code is more versatile and, since it is licence-free, it suites better with the policy of code distributed in the form of Open Source.

    Having user-friendly tutorials to quickly convert MATLAB code into C++ code is a hot topic for applications in several fields. To facilitate the conversion from MATLAB to C/C++, the MATLAB developers have recently created a toolbox called MATLAB Coder toolbox containing functions and tools to facilitate a (semi-)automatic code conversion.

    In this book, using significant examples of increasing complexity, we have described how to exploit the MATLAB Coder to create static .lib libraries, .exe executables and .cpp source code starting from MATLAB .m functions. In particular, starting from some case studies based on simple functions able to manage numerical inputs, we have shown how to manage various parameters of the MATLAB Coder toolbox, in order to be able to convert even complex functions based on image processing algorithms.

    Currently, in the literature there are no many manuals designed to guide step-by-step people interested in using the MATLAB Coder. We therefore hope that this document will be a valid help for developers interested in easily and quickly converting MATLAB code to C++ code.

    Abstract (versione Italiana)

    Al giorno d’oggi, molti dei tools ed applicativi utilizzati in campo biomedicale sono sviluppati in linguaggio MATLAB (The MathWorks, Inc., MA, USA). Tuttavia, il codice C++ risulta essere più versatile e, non essendo collegato a licenze di utilizzo, meglio si adatta alla politica di codice distribuito in forma di Open Source.

    Poter disporre di protocolli user friedly per convertire in breve tempo codice MATLAB in codice C++ è un hot topic per applicazioni in vari settori. Per facilitare il passaggio dal linguaggio MATLAB al linguaggio C/C++, gli sviluppatori MATLAB hanno recentemente realizzato un toolbox chiamato MATLAB Coder contenente varie funzioni e strumenti per facilitare la conversione (semi-)automatica del codice.

    In questo libro, utilizzando esempi significativi di complessità crescente, mostriamo come sfruttare il MATLAB Coder per realizzare librerie statiche .lib, eseguibili .exe e codice sorgente .cpp partendo da codice MATLAB .m. In particolare, partendo da casi di studio basati su funzioni semplici in grado di gestire input numerici, abbiamo mostrato come sfruttare i vari parametri del toolbox MATLAB Coder, per riuscire poi a convertire funzioni anche complesse basate su algoritmi di analisi di immagini.

    Attualmente in letteratura non sono presenti molti manuali create per guidare passo-passo possibili interessati nell’utilizzo del MATLAB Coder. Speriamo quindi che questo documento possa essere un valido aiuto per gli sviluppatori interessati a convertire in maniera facile e veloce codice MATLAB in codice C++.

    Introduction

    Nowadays, MATLAB is one of the most popular programming environments, especially among engineers and researchers working in the health field. In particular, MATLAB represents a powerful programming language optimized for mathematical computation based on multidimensional matrices. Thanks to these characteristics, it is one of the most common languages in the biomedical world where it is used for the development of several tools and applications, especially in prototype form. However, it is not a licence-free environment and the need to have a license to use MATLAB represents a limit for the dissemination and use in the community of the developed code.

    On the other hand, C++ is an open source-code that does not require any license for development and distribution. For this reason it is widely spread in the community although it requires greater programming skills in the code development stage. Being able to quickly and easily convert MATLAB code into C++ code may therefore be very interesting for applications in many fields, considering that C and C++ are among the most popular open source programming languages ​​used in the industry. However, since MATLAB and C++ are two syntactically and conceptually very different languages, a possible step-by-step manual conversion of the MATLAB algorithm would present various problems related first of all to the introduction of potential errors during the conversion process, which moreover would be also a very time-consuming task. Furthermore, it will be necessary to maintain two separate implementations of the algorithm not automatically synchronized with each other.

    To facilitate a (semi-)automatic code conversion, the MATLAB developers have recently developed the MATLAB Coder™ toolbox containing several functions and tools to help the code conversion and build static .lib libraries, .exe executable files, or code. source .cpp. The possibility of being able to convert (semi-)automatically the code could be very appreciated. The MATLAB Coder may therefore be a valuable aid for developers engaged in both research and the industrial world.

    In this book, we analyse some of the many opportunities offered by the MATLAB Coder toolbox to be able to easily and quickly convert MATLAB code into C++ code with the aim of creating a step-by-step guide to help those interested in using the MATLAB Coder toolbox. In particular, using case studies of increasing difficulty, all the steps to obtain static libraries, executables and C++ source code starting from MATLAB code will be explained and illustrated.

    This book is organised in the following chapters:

    • Chapter1: description of the Materials and Methods, with a digression on the versions used of MATLAB, Microsoft Visual Studio, MATLAB Coder and OpenCV library.

    • Chapter2: first step-by-step example to create a static library .lib, an executable file .exe and source code .cpp starting from the MATLAB .m code of a function that adds two double numbers.

    • Chapter3: second step-by-step example to create a static library .lib, an executable file .exe and source code .cpp starting from the MATLAB .m code of a function that accepts an image as input and returns it in output after adding a constant value to the intensity of each pixel of the image.

    • Chapter4: third step-by-step example to create a static library .lib, an executable file .exe and source code .cpp starting from the MATLAB .m code of a function that accepts an image as input and processes it identifying the outlines of the objects represented in it using the classic Sobel algorithm.

    • Chapter5: conclusions with particular emphasis on the importance of creating a step-by-step guide to quickly convert MATLAB code to C++ code.

    CHAPTER. 1: Materials and Methods

    All the analyses carried out in this work

    Enjoying the preview?
    Page 1 of 1