Execute programm on Rasberry, DONT wait for answer

조회 수: 1 (최근 30일)
s p
s p 2016년 6월 13일
편집: s p 2016년 6월 14일
Hey guys, im executing a bash file on my raspberry with that matlab command
system(mypi,'bash ~/spidev/ex.sh')
The bashfile removes some old files and than executes a C-Code. My Problem is that matlab is waiting for the program to finish. I tried this:
system(mypi,'bash ~/spidev/ex.sh &')
but its still waiting. If i enter the same command to the terminal manually, the raspberry doesnt wait for the answer. Any ideas how to send only the command and instantly proceeding with my own matlab-code???

답변 (1개)

Andrew Bliss
Andrew Bliss 2016년 6월 13일
I haven't used matlab with a Raspberry, so I'm not familiar with the system syntax you're using (the 'mypi' argument). Can you run something simple like 'dir' or 'ls' and get what you'd expect?
  댓글 수: 1
s p
s p 2016년 6월 14일
편집: s p 2016년 6월 14일
mypi is an object of type "raspi" that contains the information about the connection to the raspberry, like device address, port name, avaiable IO etc.
simple commands like dir or ls are working well. To execute the bashscript works too, but the command "system".... i will cite from the documentation:
"The operation waits for the command to finish execution before returning the exit status of the command to the status variable."
But i dont want to wait

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Installation Setup and Configuration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by