Getting an Age from Dataset
조회 수: 8 (최근 30일)
이전 댓글 표시
I'm trying to get an age from the following data in a matrix array/table, just unsure how to apply the code to my work. If anyone could help it would be amazing!

댓글 수: 3
Star Strider
2021년 10월 20일
One possibility —
DOB = datetime(['06 Jul 1951'; '15 Aug 1943'], 'InputFormat','dd MMM yyyy')
CollectionDate = datetime(['01 Mar 2006'; '02 Mar 2006'], 'InputFormat','dd MMM yyyy')
Age = caldiff([DOB CollectionDate], {'years' 'months' 'days'}, 2)
.
답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!