Matlab can not find my m-files and gives this failure notice even when in the path.

>> [f1 f2] = READ2F ('4RA1324A.DAT'); Cannot find an exact (case-sensitive) match for 'READ2F'. Do you want: READ2F (in C:\Users\xxx\Documents\MATLAB\READ2F.M)?
My old READ2F.m file is in the path, yet I get this message. Same result for ALL and ANY m files attempted.
------Interestingly, no opportunity to say "yes" to this question. Clarity greatly appreciated.

Risposte (4)

Do you use the exact upper/lower case of the functions? Please check this by:
which read2f -all
What does "same result for ALL and ANY m files attempted" mean exactly?

1 Commento

I like that which thing. It just confirmed that it is looking in the right place.
Something dumb I am doing with fopen structure that MATLAB used to love, and now hates.
Thanks!

Accedi per commentare.

I remember that perhaps a month ago someone ran in to something similar. I seem to recall that it was a MATLAB PATH problem for them -- a typo along the way.
Errors of this nature can sometimes also happen if there are spaces in directory names that are not being protected against. For example,
cd C:\Users\Walter Roberson\Documents
is a problem because the command/function duality of MATLAB would treat this as
cd('C:\Users\Walter','Roberson\Documents')
MATLAB PATH problems can also occur when networked filesystems are involved, if one of the systems sees the file as being in a different location than the other does. Or sometimes networked file systems are obstinate about remote authentication and can refuse to believe that you (remotely) are the person who (locally) owns the files when exclusive access owner or group access has been configured.
I see the error occurs between release 10b and 11.
I found a machine with 10 on it, and it all works.
So I looked a bit further and suspect that:
It has something to do with my original use of fopen
What I want is to be able to call the function and any one of the data files I use
fid = fopen(nasafile); if (fid < 0) error(['Could not open file: ' nasafile]); end comments=fgetl(fid);
My guess is it's fopen(nasafile) that is the problem
If I run the function, and forget the fid = fopen(nasafile);
it all works fine.
what is intriguing, is that MATLAB 10b and before would run the function no problem.
Standing by to be embarassed.

1 Commento

To check: you are indicating that when you fopen() that file, that after that it complains about not being able to find matches for everything ?
Hmmm... could you try
which -all fopen
just in case somehow your own fopen.m is in the path ?

Accedi per commentare.

Categorie

Scopri di più su Get Started with MATLAB in Centro assistenza e File Exchange

Richiesto:

il 11 Ott 2011

Community Treasure Hunt

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

Start Hunting!

Translated by