x = 5 switch (x) case 1, disp('x is equal to 1'); case 2, disp('x is equal to 2'); case {3,4} disp('x is equal to 3 or 4'); % otherwise % disp('x is less than 1 or greater than 4'); end;