Standalone file on a Raspberry Pi 3

3 views (last 30 days)
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

Accepted Answer

Mark Sherstan
Mark Sherstan on 19 Dec 2018
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 Comments
Henrik Bjurström
Henrik Bjurström on 20 Dec 2018
Ok, then I need to consider some alternative solution. Thanks Mark and Walter for taking time answering! Much appriciated.
Walter Roberson
Walter Roberson on 20 Dec 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.

Sign in to comment.

More Answers (0)

Categories

Find more on Application Deployment in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!