Running a script from a Linux terminal using "matlab -r"

조회 수: 8 (최근 30일)
Edwin Froelich
Edwin Froelich 2019년 6월 27일
답변: Jan 2019년 6월 27일
Hi!
I want to run a script from the terminal inside my Linux operating system. I successfully do so using
matlab -nosplash -nodesktop -r "myfunction(arg1,agr2...,argN)"
but then the program quits because it runs into a line inside a second function that is called by myfunction which is
mkdir
The error says
Permission denied
Any thoughts?

채택된 답변

Jan
Jan 2019년 6월 27일
The error message means, that you try to create a folder inside a path, in which you do not have write access. The solution is easy: Choose the correct parent folder for mkdir, e.g.
mkdir('~/yourfolder')
or any otehr location. With just
mkdir('yourfolder')
the current folder is used, and this might not be what you expect it to do. Most of all it can differ from the startup folders, which is active, when you start the Matlab GUI.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by