user4980414
user4980414

Reputation:

Can I run matlab on raspberry pi?

I have developed a system using signal processing technique in matlab. I want to use raspberry pi to this system.

In this link, they say Octave, Scilab ,FreeMat tools can be used to replace pc with raspberry pi.

Can i use this tools to run signal processing algorithms?

Upvotes: 3

Views: 3939

Answers (4)

mohith prabhu
mohith prabhu

Reputation: 11

With the R2018b release of MATLAB, you can deploy your MATLAB code on Raspberry Pi as a standalone executable.

Refer the Deploying MATLAB functions on Raspberry Pi for more information.

Upvotes: 1

gregswiss
gregswiss

Reputation: 1456

Another option is to use the MATLAB coder or the MATLAB Embedded Coder to generate C code from the MATLAB code. Note that only a sub-set of the MATLAB language supports code generation. That code can then be compiled and run natively on Raspberry Pi.

Upvotes: 1

Daniel
Daniel

Reputation: 36710

Matlab/Simulink can not run m code directly on raspberries, but you can run Simulink models using the raspberry support package for simulink. This includes Matlab S-Functions, which contain m Code.

The typical workflow is:

  1. Create a simulink model which implements the functionality. Try to generate code and test it if possible on your Pc.

  2. Put in the blocks from the support package to get access to the io of the raspberry. Change the target to the raspberry and built it again.

  3. Download the binary to the raspberry and start it. The application now runs on the raspberry, the pc is not needed.

Upvotes: 3

rayryeng
rayryeng

Reputation: 104535

No it is not possible. MATLAB can only run on Intel x86 architectures, and the Raspberry Pi uses an ARM processor. See here for which platforms MATLAB supports: http://www.mathworks.com/support/sysreq/current_release/.

However, you can use MATLAB to interface with the Raspberry Pi in order to get sensor and image data: http://www.mathworks.com/hardware-support/raspberry-pi-matlab.html

If you want to run signal processing algorithms, if you can, stick with Octave's signal package - http://octave.sourceforge.net/signal/ - and yes it is possible to run Octave on a Raspberry Pi: http://wiki.octave.org/Rasperry_Pi.

Alternatively, try installing NumPy and SciPy together with Python - http://wyolum.com/numpyscipymatplotlib-on-raspberry-pi/ - and use the signal package from that platform: http://docs.scipy.org/doc/scipy/reference/signal.html. NumPy has very similar syntax to MATLAB and it'll take you no time at all to learn it. http://cs231n.github.io/python-numpy-tutorial/


You have lots of alternatives... but unfortunately you can't use MATLAB. Besides which, MATLAB uses Java as the backbone, and running Java on a Raspberry Pi is very slow. Not only that, but MATLAB is several GB large, and to have this program occupy a good chunk of your SD card is very counter productive.

Upvotes: 3

Related Questions