Matlab not recognizing the file within directory

I've had this issue once and this is the second time. When I'm running a file whose path has already been set and all the relevant folders have been added, Matlab is simply not recognizing the file. Its giving me an error "Undefined function or variable 'myFile'". I did resolve the first time by copying the code to a new script and saving them in different location and this is the second time that it has occurred. How could I resolve this matter?
And yes, its just one piece of code file that is getting the error, the rest o my previous matlab works are running successfully.

1 件のコメント

Jan
Jan 2014 年 2 月 1 日
How is the M-file called exactly?

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

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 1 月 24 日

0 投票

Try giving the command
rehash toolbox

6 件のコメント

Ayesha
Ayesha 2014 年 1 月 24 日
Nothing happened. That's very strange even though codes in other folders are running fine.
Walter Roberson
Walter Roberson 2014 年 1 月 24 日
Try
clear all
close all
rehash toolboxreset; rehash toolboxcache
and try again.
Ayesha
Ayesha 2014 年 1 月 24 日
No effect :(
Walter Roberson
Walter Roberson 2014 年 1 月 24 日
What does
which MyFile
report? And
!ls My*.*
Also just in case... please check that you did not mix up digit one ('1') and lower-case L ('l') in the name of the file or the place you are calling it.
Ayesha
Ayesha 2014 年 2 月 1 日
編集済み: Walter Roberson 2014 年 2 月 1 日
EDU>> which MyFile
'MyFile' not found.
EDU>> !ls My*.*
'ls' is not recognized as an internal or external command,
operable program or batch file.
Walter Roberson
Walter Roberson 2014 年 2 月 1 日
Try
ls My*.*
without the '!' before it. (You had not indicated the OS you were using and I guessed incorrectly.)

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

カテゴリ

ヘルプ センター および File ExchangeSearch Path についてさらに検索

質問済み:

2014 年 1 月 24 日

コメント済み:

Jan
2014 年 2 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by