I found the correct format. It is as follows:
clc,clear
day=input('Enter date of the month ');
if any(day==[3 10 17 24])
dayName = 'Monday' ;
elseif any(day==[4 11 18 25])
dayName = 'Tuesday' ;
elseif any(day==[5 12 19 26])
dayName = 'Wednesday' ;
elseif any(day==[6 13 20 27])
dayName = 'Thursday' ;
elseif any(day==[7 14 21 28])
dayName = 'Friday' ;
elseif any(day==[1 8 15 22 29])
dayName = 'Saturday';
elseif any(day==[2 9 16 23 30])
dayName = 'Sunday';
end
disp(dayName)