Specify file to be called from command line (.m/.p)

If you had 2 files, one a .m and one a .p, from the command line can you tell MatLab which file to run? If the file was names Test.m and Test.p and the file contained:
[~,~,ext] = fileparts(which(mfilename))
ext will always return .p, so is there anyway when you type "Test" in the command window, I can get the .m to run and not the .p? Would it be the same if Test took parameters? Test(param1, param2)

 採用された回答

Thorsten
Thorsten 2014 年 12 月 18 日
編集済み: per isakson 2014 年 12 月 18 日

1 投票

No, you can't run the mfile if a pfile of the same name is in the same directory as the mfile:
When you call a P-code file, MATLAB gives it execution precedence over its
corresponding .m source file.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFiles and Folders についてさらに検索

質問済み:

2014 年 12 月 17 日

編集済み:

2014 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by