From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error in MIN and MAX
Date: Sun, 30 May 2010 21:16:36 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <htv6af$nmb$>
References: <htrjji$34i$> <hts20o$vt$> <htt5bg$fli$> <httm7f$14t$> <httojr$f0t$> <htu2ol$ank$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 31 May 2010 02:18:57 +0000 (UTC)
Injection-Info:; posting-host="+o+6hChWtT2SwFkflj892w";
	logging-data="24267"; mail-complaints-to="";	posting-account="U2FsdGVkX18QyXjqxPPzjw4O4tCWPvmA"
User-Agent: Thunderbird (Windows/20100228)
In-Reply-To: <HIDDEN>
Cancel-Lock: sha1:I9SHBBgIZHga4l3W/vYEEMMS6QI=
Xref: comp.soft-sys.matlab:640767

Matt J wrote:
> dpb <> wrote in message 
> <httojr$f0t$>...
>> > I'm actually a bit dumbfounded by how often this occurs. If you're > 
>> trying to use the same name for two different things (function and > 
>> variable), I tend to think that you really don't know what's going on 
>> in > your code.
>> OTOH, given the size of the ML namespace, in some ways my surprise is 
>> it doesn't happen even more often... :)
> No, the save of the Matlab namespace is not relevant. It is perfectly 
> harmless to use i, j, min, max, etc... as variable names as long as you 
> don't then try to use them as functions later on in the same workspace.
> The problem only occurs when people deliberately try to use the same 
> name for 2 different things in the same mfile.

Well, I think the namespace size _does_ have quite a lot to do with it 
myself just from the likelihood standpoint of a name collision.

That aliasing is ok from Matlab syntax standpoint just makes the error 
more difficult to catch when it happens.