How to convert day information to a number?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2021년 9월 24일
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.
.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!