empty string in switch statement

Peter L. Søndergaard peter at sonderport.dk
Mon Nov 24 07:55:08 CST 2008


The following script executes differently under Matlab and Octave


f='';

switch(f)
 case ''
  disp('Equals.');
end;


In Matlab, the case statement matches and the word is printed. In
Octave, there is no match.

I get the completely same behaviour if I use "case []" instead.

I am using Octave 3.0.1 from the Fedora package
octave-3.0.1-1.fc9.x86_64

Matlab version 7.4.0.287 (R2007a)

Cheers,

Peter.





More information about the Bug-octave mailing list