Hi, Community
I just have a simple answer... How to extract this cell data :
fg = '{'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'}';
Into :
fg = [07-Apr-2022; 08-Apr-2022; 09-Apr-2022] (datetime array)
Thank you so much...

 채택된 답변

KSSV
KSSV 2022년 4월 21일

0 개 추천

fg = {'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'};
datetime(fg)
ans = 3×1 datetime array
07-Apr-2022 08-Apr-2022 09-Apr-2022

댓글 수: 4

Tyann Hardyn
Tyann Hardyn 2022년 4월 21일
Error using datetime (line 640)
Could not recognize the date/time format of '{'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'}'. You can
specify a format using the 'InputFormat' parameter. If the date/time text contains day, month, or time
zone names in a language foreign to the 'en_US' locale, those might not be recognized. You can specify
a different locale using the 'Locale' parameter.
Its an error, Sir
KSSV
KSSV 2022년 4월 21일
How and why you have '{'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'} ??
Tyann Hardyn
Tyann Hardyn 2022년 4월 21일
Its from uicalendar output when i pick a multiselect dates, Sir
Can you try
fg = datetime(fg,'InputFormat','dd-MMM-yyyy')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

질문:

2022년 4월 21일

댓글:

2022년 4월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by