Run Something.sh file from matlab

조회 수: 42 (최근 30일)
Rajitha Dehigaspitiya
Rajitha Dehigaspitiya 2016년 5월 2일
답변: Dario 2024년 7월 19일
I want to run .sh file from the matlab . I have tried following way but its giving the permission denied error.
system('/home/scripts/Something.sh')
/bin/bash: /home/scripts/Something.sh: Permission denied
  댓글 수: 1
Jan
Jan 2016년 5월 2일
And can you run it from the shell directly? Who is he owner and is the executable flag activated?

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

답변 (3개)

Walter Roberson
Walter Roberson 2016년 5월 2일
system('sh /home/scripts/Something.sh')
  댓글 수: 2
Naveen Jacob
Naveen Jacob 2020년 5월 5일
Thanks it worked !!
Ashita Ashok
Ashita Ashok 2020년 6월 23일

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


DanielFromIllinois
DanielFromIllinois 2022년 3월 14일
If you're running this from Windows (not mac or linux) I got this to work by doing:
system('C:\Apps\Git\git-bash.exe Something.sh')
The above assumes that Something.sh is in your current directory within MATLAB. You could provide an absolute path like:
system('C:\Apps\Git\git-bash.exe C:\Users\UserName\home\scripts\Something.sh')

Dario
Dario 2024년 7월 19일
Hello everyone,
do someone know if there is a way to do the same but in simulink? because created a matlab function block calling the sysrem function but it does not work, i tried to 'coder.extrinsic' the fuction but it seems that it does not work either.

카테고리

Help CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by