パスを指定してMAT​LABファイルを実行​することはできますか​?

22 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 19 Aug 2016
絶対パスを指定してMATLABファイルを実行する方法を教えてください。以下の方法で"myTest.m"を実行しようとすると、エラーとなります。
>> C:\MATLAB\R2007b\work\myTest
 
??? C:\MATLAB\R2007b\work\mytest
|
エラー: 予期せぬ MATLAB 演算子です。
英語版の場合 ERROR: ??? C:\MATLAB\R2007b\work\myTest | Error: Unexpected MATLAB operator.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Aug 2016
エラーの原因は、パスの中に含まれる"\"が演算子と認識されるためです。
このような場合、runコマンドを使用して実行します。
>> run('C:\MATLAB\R2007b\work\myTest');

More Answers (0)

Categories

Find more on プログラミング in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!