How to convert day information to a number?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
John Lee
il 24 Set 2021
Commentato: Star Strider
il 24 Set 2021
How can I convert day information to a number?
For instance, Mon to 1, Tue to 2, etc.
Fo from character to number data.
0 Commenti
Risposta accettata
Star Strider
il 24 Set 2021
Experiment with something like this —
daynr = @(x) find(strcmp(x, {'Mon','Tue','Wed','Thu','Fri','Sat','sun'}));
nr = daynr('Thu')
Everything depends on the context it will be used in, so this is just an example of one approach.
.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Whos 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!