Prev: Time-Frequency Analysis
Next: error compiling mex file
From: teki on 10 Aug 2010 13:23 Hi, 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" <slord(a)mathworks.com> wrote in message <hute1f$ifa$1(a)fred.mathworks.com>... > > "Theophane " <theo.weber(a)hotmail.com> wrote in message > news:huspi6$6ko$1(a)fred.mathworks.com... > > Matlab has gone mad! It won't accept any declaration other than > > predeclared matlab functions (say, fft). Almost any other function call > > returns 'Undefined function or method bla bla'. > > > > 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 > slord(a)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 >
From: Shanmugam Kannappan on 10 Aug 2010 13:38 Hi, 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 " <radiotek(a)gmail.com> wrote in message <i3s1tq$l3n$1(a)fred.mathworks.com>... > Hi, > > 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" <slord(a)mathworks.com> wrote in message <hute1f$ifa$1(a)fred.mathworks.com>... > > > > "Theophane " <theo.weber(a)hotmail.com> wrote in message > > news:huspi6$6ko$1(a)fred.mathworks.com... > > > Matlab has gone mad! It won't accept any declaration other than > > > predeclared matlab functions (say, fft). Almost any other function call > > > returns 'Undefined function or method bla bla'. > > > > > > 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 > > slord(a)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 >
From: teki on 10 Aug 2010 15:34 Hi Shan, 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" <shanmugambe(a)gmail.com> wrote in message <i3s2ps$i16$1(a)fred.mathworks.com>... > Hi, > > 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 " <radiotek(a)gmail.com> wrote in message <i3s1tq$l3n$1(a)fred.mathworks.com>... > > Hi, > > > > 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" <slord(a)mathworks.com> wrote in message <hute1f$ifa$1(a)fred.mathworks.com>... > > > > > > "Theophane " <theo.weber(a)hotmail.com> wrote in message > > > news:huspi6$6ko$1(a)fred.mathworks.com... > > > > Matlab has gone mad! It won't accept any declaration other than > > > > predeclared matlab functions (say, fft). Almost any other function call > > > > returns 'Undefined function or method bla bla'. > > > > > > > > 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 > > > slord(a)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 > >
From: Jan Simon on 10 Aug 2010 16:27 Dear teki, 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
From: teki on 10 Aug 2010 17:10
Hi 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.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i3scmp$t6t$1(a)fred.mathworks.com>... > Dear teki, > > 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 |