X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Message-ID: <39BE5CB1.7E8FD4E9@umich.edu> Date: Tue, 12 Sep 2000 12:41:21 -0400 From: Eric Durant X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.soft-sys.matlab Subject: if (1 | []) : inconsistencies? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit After reading 2-12 ff. and 2-398 ff. in the Matlab Function Reference, Volume 1, Version 5, I expect all of the following to give the same result ('T'), but they don't. Is this a bug or documentation error, or have I missed something? expr=(1|[]); if expr , disp('T'), else disp('F'), end % F expr=([]|1); if expr , disp('T'), else disp('F'), end % F if(1|[]), disp('T'), else disp('F'), end % T if([]|1), disp('T'), else disp('F'), end % F if(all(1|[])), disp('T'), else disp('F'), end % T if(all([]|1)), disp('T'), else disp('F'), end % T I've tested this with R11.1 on PCWIN and SOL2. -- Eric Durant http://edurant.com/