How to create a function of calendar in Matlab ?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Irfan Tariq
am 19 Jun. 2020
Beantwortet: Anmol Dhiman
am 24 Jun. 2020
how to creat a function for Number of Months of the year, Such that when we find the June and July, Function must declare it as month of summer vacation and when we find the December and January, Function must declare it as month of winter vacation. Otherwise it must show that “ it is time to go to University.
0 Kommentare
Akzeptierte Antwort
Anmol Dhiman
am 24 Jun. 2020
Hi Irfan,
You can use the below code
function calender(month)
if(month == 6 || month == 7)
disp("month of summer vacation");
elseif(month == 1 || month == 12)
disp("month of winter vacation");
else
disp("Wrong inpit. Please enter month from 1 to 12");
end
end
Regards,
Anmol Dhiman
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!