From: Alain on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hiptb2$5tb$1(a)fred.mathworks.com>...
> Loren Shure <loren.shure(a)mathworks.com> wrote in message <MPG.25ba36004953ef8a989aa1(a)news.mathworks.com>...
> > In article <hio31v$ekl$1(a)fred.mathworks.com>, spamanon(a)yahoo.com says...
> > > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hio2b1$sht$1(a)fred.mathworks.com>...
> > > > "Alain " <berdoz(a)code7136.nrl.navy.mil> wrote in message <hio1kh$e4u$1(a)fred.mathworks.com>...
> > > >
> > > > >
> > > > > thanks for the thorough response !
> > > >
> > > > No problem. If you ever figure out why the poofing of X into your workspace caused problems, I'd be grateful if you could post the explanation. I have a certain interest in cataloguing the different problems that poofing can cause and yours seems like a new one!
> > >
> > >
> > > I too would like to see the code that caused the problem. I seem to remember a thread where WHOS cured a problem very similar to this one about 5 months ago, but I cannot find it.
> > >
> >
> > is it possible you have a program on your path with the same name as the
> > variable? That could've caused all kinds of mayhem/confusion to matlab
> > and caused an error.
> >
>
> That's what I thought too, Loren, but the error message the OP is reporting is not consistent with that. He claims an error message of "variable undefined" whereas if a function were shadowing the variable, he should see a message of "Insufficient arguments to function X()" or something along those lines.
>
>
ok here is more information as I am finding them....
sorry but this a relatively large code comming from different sources ( fun !).
But, I think you are sniffing around the right thing here.
The variable X was indeed the name of a script in the path; to go around it the author
did redefine the path in the calling function to eliminate the subdirectory where the script is defined. And reset the path at the end of the function.
From: Matt J on
"Alain " <berdoz(a)code7136.nrl.navy.mil> wrote in message <hipuon$7gq$1(a)fred.mathworks.com>...
> "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hiptb2
> > That's what I thought too, Loren, but the error message the OP is reporting is not consistent with that. He claims an error message of "variable undefined" whereas if a function were shadowing the variable, he should see a message of "Insufficient arguments to function X()" or something along those lines.
> >
> >
> ok here is more information as I am finding them....
> sorry but this a relatively large code comming from different sources ( fun !).
> But, I think you are sniffing around the right thing here.
> The variable X was indeed the name of a script in the path; to go around it the author
> did redefine the path in the calling function to eliminate the subdirectory where the script is defined. And reset the path at the end of the function.
=========

The author would have needed to issue the rehash() command in order for the path change to be registered by MATLAB. If he did not, you might experiment with sticking in rehash just for fun.

However, as I said above, I would not have expected a "Variable Undefined" error message. I would have expected error messages along the lines of what you get when you run the following example function


function test

eval('sqrt=1,')

sqrt,


end


>> test

sqrt =

1

??? Error using ==> sqrt
Not enough input arguments.

Error in ==> test at 5
sqrt,
First  |  Prev  | 
Pages: 1 2 3
Prev: Subcript
Next: CRC-32 for IEEE 802.11-2007