Standalone file on a Raspberry Pi 3

Hi! I have a Matlab algorithm with a number of operations and function files that are working fine on my PC. Now I would like to create a standalone version of this package to run from a Raspberry Pi 3 without any connection to my PC. The algorithm must be able to read one additional file as input data. However, I do not need to control anything from the Pi, all I want is to analyze the input data and possibly plot something on the touchscreen connected to the Pi to verify that data seems ok during some field tests. As I’m new to using the Raspberry Pi, I don’t know how to manage this, do I need any special toolboxes or anything? I’m working on a 2018b license and then I have the Matlab Compiler toolbox if that helps. What is the best way of approaching this problem?
I have tried to search for this problem but I’m afraid I do not fully understand. Will I manage to do this with Simulink? And can that file uploaded on the Raspberry Pi manage to read the input data file in order to analyze that data in that case?
Thanks for any answers!
/Henrik Bjurström

 Respuesta aceptada

Mark Sherstan
Mark Sherstan el 19 de Dic. de 2018

1 voto

You cannot run MATLAB code on the Raspberry Pi so generating code in Simulink to run on the RPI3 is the way to go. You will have to create an executable, some more information can be found here. There are also some helpful links and resources here.

4 comentarios

Henrik Bjurström
Henrik Bjurström el 19 de Dic. de 2018
Hi Mark! Thanks for your answer!
And it doesn't work to compile the algorithm using Matlab Compiler? I tried that but the .exe-file didn't work on my RP3. Are you saying that it shouldn't work either?
/Henrik
Walter Roberson
Walter Roberson el 19 de Dic. de 2018
Editada: Walter Roberson el 19 de Dic. de 2018
Absolutely NO, MATLAB Compiler will not work to run on RPi3, and IMHO you should expect that MATLAB Compiler will never be modified / enhanced to run on RPi3.
MATLAB Compiler produces x64 code only (x86 in previous releases), but RPi3 is Broadcom BCM2837 CPU which is ARM Cortex series, which is not binary compatible with x64.
The MATLAB products that are relevant are MATLAB Coder and Simulink Coder.
As of R2018b it became possible to deploy some MATLAB code to Raspberry Pi; see https://www.mathworks.com/help/supportpkg/raspberrypiio/run-on-hardware.html . This is not the same as MATLAB Compiler. (Also for other people reading this: There is no corresponding Arduino support in R2018b.)
Henrik Bjurström
Henrik Bjurström el 20 de Dic. de 2018
Ok, then I need to consider some alternative solution. Thanks Mark and Walter for taking time answering! Much appriciated.
Walter Roberson
Walter Roberson el 20 de Dic. de 2018
I mentioned above that as of R2018b it become possible to deploy some MATLAB code to Raspberry Pi. I might be misreading, but it looks to me as if the subset of supported functions does not include any filesystem access.... but there are other interpretations that suggest it might, possibly.
... Looks to me as is perhaps you would be able to create a raspi and use system() on it to talk to linux. I/O back and forth might be a bit icky as it is not clear that any file I/O is directly supported. It would all need some experimentation.
The file system access would, I think, be the main stumbling block, provided that the other aspects were deployable to RPi.
Talking to the touch screen might not be as clean as what one might hope.
Now, the main alternate route is MATLAB Coder, which has documented methods for linking to external libraries. What it does not have is direct support for RPi -- RPi is just an unknown generic target as far as MATLAB Coder is concerned.
... It is also possible that there is useful facilities that are weakly documented.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Application Deployment en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Preguntada:

el 19 de Dic. de 2018

Comentada:

el 20 de Dic. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by