Guide for Dummies: from MATLAB to C++ through the MATLAB Coder: English and Italian Book
By Filippo Piccinini and Sofia Belloni
()
About this ebook
Related to Guide for Dummies
Related ebooks
Schaum's Easy Outline of Programming with Java Rating: 3 out of 5 stars3/5The Dev-c++ Reference Manual Rating: 5 out of 5 stars5/5Crystal Clear Java: 1St Edition Rating: 0 out of 5 stars0 ratingsJava Programming for Beginners: Programming Rating: 0 out of 5 stars0 ratingsSoftware Development Accelerated Essentials: What You Didn't Know, You Needed to Know Rating: 0 out of 5 stars0 ratingsHow Transistor Area Shrank by 1 Million Fold Rating: 0 out of 5 stars0 ratingsJava Demystified Rating: 3 out of 5 stars3/5Mastering Technical Mathematics, Third Edition Rating: 3 out of 5 stars3/5Designing Secure IoT Devices with the Arm Platform Security Architecture and Cortex-M33 Rating: 0 out of 5 stars0 ratingsIntel Xeon Phi Processor High Performance Programming: Knights Landing Edition Rating: 0 out of 5 stars0 ratingsData Structures in C / C ++: Exercises and Solved Problems Rating: 0 out of 5 stars0 ratingsModern C for Absolute Beginners: A Friendly Introduction to the C Programming Language Rating: 0 out of 5 stars0 ratingsElectronics And Communication Engineering A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsPython for Probability, Statistics, and Machine Learning Rating: 0 out of 5 stars0 ratingsWavelet Neural Networks: With Applications in Financial Engineering, Chaos, and Classification Rating: 0 out of 5 stars0 ratingsLulu Sucks! epub Formating, TOC, & NCX for Dummies. Publish your book in the Apple iBookstore for only $100 or $2.99 Rating: 0 out of 5 stars0 ratingsLearn Java for Android Development: Java 8 and Android 5 Edition Rating: 0 out of 5 stars0 ratingsProgramming the Intel Edison: Getting Started with Processing and Python Rating: 1 out of 5 stars1/5Nexus 7 For Dummies (Google Tablet) Rating: 0 out of 5 stars0 ratingsSchaum's Outline of XML Rating: 0 out of 5 stars0 ratingsLearn All about Evolution of Computers Rating: 0 out of 5 stars0 ratingsAutomated Theorem Proving in Software Engineering Rating: 0 out of 5 stars0 ratingsProgramming Techniques using Python: Have Fun and Play with Basic and Advanced Core Python Rating: 0 out of 5 stars0 ratingsFundamentals of Digital Image Processing: A Practical Approach with Examples in Matlab Rating: 3 out of 5 stars3/5Schaum's Outline of Computer Architecture Rating: 0 out of 5 stars0 ratingsSchaum's Easy Outline of XML Rating: 0 out of 5 stars0 ratingsEmbedded Computing: A VLIW Approach to Architecture, Compilers and Tools Rating: 0 out of 5 stars0 ratingsJava Design Patterns: A Hands-On Experience with Real-World Examples Rating: 0 out of 5 stars0 ratingsProgramming and Customizing the Multicore Propeller Microcontroller: The Official Guide Rating: 4 out of 5 stars4/5
Programming For You
Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards Rating: 0 out of 5 stars0 ratingsWeb Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratings
Reviews for Guide for Dummies
0 ratings0 reviews
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