Switch function to output number of days in a month
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to use switch to output number of days for each month, however I am having issues with my input, Please advice.
here is my code:
n = input('Enter the month name: ');
switch n
case January
Days = '31';
otherwise
disp('Invalid month name');
return;
end
disp(['Days ', Days]);
0 Commenti
Risposta accettata
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Calendar in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!