MATLAB from command line - Cannot find script in the current direcoty

3 ビュー (過去 30 日間)
Luca Amerio
Luca Amerio 2015 年 7 月 17 日
コメント済み: Luca Amerio 2015 年 7 月 17 日
Hi, I just installed Matlab on a Linux machine that doesn't have the X server. Therefore I launch matlab using the -nojvm -nodisplay -nosplash options to run it from command line.
I can correctly launch commands from the "command windows", but it seams to not find any script. Here is an example:
>> dir
. .. test.m
>> ls
test.m
>> which test.m
/home/amerio/test/test.m
>> pwd
/home/amerio/test
>> test.m
Undefined variable "test" or function "test.m".
The script "test.m" is there. Both dis, ls and which can see it. However Matlab returns the "Undefined function" error when i try to run it.
I tried to change the permissions of test.m to allow execution from anyone (chmod 777 test.m), but this didn't work.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 17 日
編集済み: Azzi Abdelmalek 2015 年 7 月 17 日
Don't add the extension. Just type
test
  1 件のコメント
Luca Amerio
Luca Amerio 2015 年 7 月 17 日
How stupid...
I'm so used to launch through the "Run" button that I missed this. Thank you very much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Find more on Startup and Shutdown in Help Center and File Exchange

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by