MATLAB Answers


I'm working on an image processing project which employs rasberry pi. I have written the code in matlab using image processing toolbox and computer vision. Can i make a standalone executable application and dump it in the pi?

Asked by SHRIKANT MAHAPATRA on 7 Jan 2016
Latest activity Commented on by Martin Florek on 12 Jul 2016
Or can i convert this matlab code to any other language which is suited for rasberry pi(pyhton)???


Sign in to comment.

2 Answers

Answer by M.Khan
on 7 Jan 2016

If your MATLAB code generates portable C code, you can create standalone executable on Raspberry Pi. Here are the steps:
  • Use MATLAB coder to generate portable C Code
  • Use packNGo to generate zip folder
  • Transfer the zip folder to your target hardware (Raspberry Pi)
  • Create makefile and build executable on Raspberry Pi
Here is the list of Image Processing Toolbox functions that explains whether the function generates portable C code:
Here is the list of Computer Vision System Toolbox functions that explains whether the function generates portable C code:


Note: MATLAB Coder and MATLAB Compiler are available for Academic license and for Professional / Commercial license, but not for Student Version or Home license. MATLAB Coder is a fairly expensive product, about $US8000 for the Professional license.
However, if you go through the Simulink route, then all current licenses of MATLAB (including Student Version) that have Simulink can generate and deploy to the Raspberry Pi without requiring MATLAB Coder.
Hello M.Khan and all Excuse me, and someone has implemented the process but remained only in theory? I try to run demo "Code Generation for Face Tracking with PackNGo", but I had problems with paths. But this is another problem that I have removed. Now I want to know how to create a Makefile for Raspberry Pi, since the code generator create files which need dll and lib? Probably I need to have installed OpenCV on RPI, too. {.so (shared object) matlab/embedded coder does not support?}. I use Win PC. Thank you for your help, support, advice and time.

Sign in to comment.

Answer by Walter Roberson
on 7 Jan 2016
Edited by Walter Roberson
on 7 Jan 2016

The Raspberry Pi cannot run .exe produced by MATLAB Compiler.
If you tweak your code and package it into a Simulink MATLAB Function Block then it can potentially be deployed to the raspberry using the Simulink facilities.

  1 Comment

Hi Walter,
Can you provide any examples on how to package a code into MATLAB Function block. I am working on this Thingpeak Project and have developed a code for the same but I am not able to generate the car counter block in the model given.
May you please help me?
Thank you, Apoorv

Sign in to comment.