I know you'll think that I don't have the path defined correctly, or that my function is not defined properly, but this is not the case. I am trying to call functions or script located in the directory i am currently browsing.
Tab autocompletes their name when I start typing the first few letters.
But as soon as I press enter, matlab gets confused. I have been using matlab for years, never encountered this problem.
Even weirder, I can copy those files in a different folder, and sometimes, just sometimes, they will work. For a bit. Before becoming un-callable again.
This does not concern all the files I am using, just some. they can be on a different drive, too.
Does anyone have any clue what is going on?
Send a listing of the names of the files in that directory to Technical
Support so they can investigate what's going on.
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
I am facing the same problem today.
I try to run the .m file in my current directory and Matlab would give the message - "Undefined function or variable". I add the current path and still it does not recognize any .m file in the current directory.
Moreover, any new .m file is not running at all, while some of the old .m files I executed previously are working fine.
Any help is most appreciated!
Many thanks,
Sundeep
"Steven Lord" <sl...@mathworks.com> wrote in message <hute1f$ifa$1...@fred.mathworks.com>...
May I know how you are trying to run the file?
I mean,r u running in the command window or directly from the m-file.
Also,please check your function name's & variables names are not the same.
Shan!
"teki " <radi...@gmail.com> wrote in message <i3s1tq$l3n$1...@fred.mathworks.com>...
I tried running the file from both the command window and directly from the m-file but neither works. The function and variable names are not conflicting.
The same function works fine on my pc (with r2008a), but not on my laptop running matlab r2009a. Even a simple m-file to display a message won't run on my laptop now.
On some other pages, someone suggested it might be a problem with the pathdef.m file, but I am not sure...I even added the path of the current directory before running the m-file, but to no avail!
Sundeep
"Shanmugam Kannappan" <shanm...@gmail.com> wrote in message <i3s2ps$i16$1...@fred.mathworks.com>...
it would be helpful, if you give us a complete description of what has happened:
1. Did Matlab work fine before?
2. What has happened in between?
3. Does "path" reply the expected toolbox folders?
4. Do you have read access to these folders?
5. Does WHICH find any of the toolbox functions?
6. Are you sure that there are no naming conflicts? If so, why?
7. Does Matlab provide any error messages, if yes, please post them.
8. Further ideas of what might be helpful to identify the problem?
Kind regards, Jan
Thanks for your reply. In response to your questions;
1. Matlab worked fine before
2. I discovered this problem four days ago. I had to go back to my desktop to run this function. Today, it worked once when I copied the file from my pc, and saved the file with a different file name on my laptop. I thought that was it, but on subsequent attempts, the m-file would not run.
3. Yes
4. Yes
5. Yes
6. I am quite positive about that. I don't understand why the same m-file runs without any error on my desktop but fails completely on my laptop.
7. Error reads - "undefined function or variable".
8. I am not sure what else can I say about this.
Many thanks,
Sundeep
"Jan Simon" <matlab.T...@nMINUSsimon.de> wrote in message <i3scmp$t6t$1...@fred.mathworks.com>...
it looks like you might have a broken hd...
us
Or a corrupted Matlab installation.
I'd probably start by removing the matlab preferences file.
> 7. Error reads - "undefined function or variable".
Please copy the complete message. Sometimes there is a subtle difference between the exact message and the thing one means to have read (sorry, I have the strong impression, that this is not English anymore - I want to say:
While it is in general a good idea to think before posting, for error messages it is the other way around: post instead of thinking.).
Something strange happens, so a tiny detail may carry the important hint.
Jan
Jan, the exact error message when I try to run (e.g. 'filename.m') reads as:
??? Undefined function or variable 'filename'.
Thanks,
Sundeep
"Jan Simon" <matlab.T...@nMINUSsimon.de> wrote in message <i3smvd$e62$1...@fred.mathworks.com>...
When I find a folder that works, every script works in that folder. So everytime I start Matlab I have to find a folder that works (totally random each time) and move all my scripts to that folder.
I use Matlab R2010 and Windows 7. I installed Matlab on my D: drive instead of C:, I don't know if that is making Matlab confused. But I have found folders on both my C and my D drive that works.
The only solution that I found to avoid this problem is to rename all the functions in the folder by adding my name at the end of the function (for instance "yourfunction.m" is then renamed with "yourfunction_yourname.m").
Please, let me know if this worked!
Thanks.
Jeremy
"Øyvind " <oyv...@online.no> wrote in message <i6vb1u$36j$1...@fred.mathworks.com>...
But if I move the contents of that folder to a different folder after Matlab is started, it works.
Oyvind
"Jeremy Lagorse" <jeremy....@veolia.com> wrote in message <i7cm8g$mms$1...@fred.mathworks.com>...
Have you tried
>> rehash
or
>> rehash path
??
seems to work for me (but I'm not 100% certain)