How to prevent "system" to block the MATLAB command line when executing a script on a Raspberry Pi?

I am using a Raspberry Pi 3B with the latest OS installed and it is connected to MATLAB.
On the Raspberry Pi, I have a Python script that acquires data from sensors connected to the Raspberry Pi, the acquisition is expected to take a couple of minutes.
I would like to start the script from the MATLAB command line with the "system" function, but I do not want it to block the MATLAB command line.
How can I do that?

 Accepted Answer

To prevent the call to the "system" function, please consider redirecting the output stream of your script to /dev/null by using the following command:
>> r = raspi();
>> system(r,'python YourPythonScript.py > /dev/null 2>&1 &')

More Answers (0)

Categories

Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!