Extract Cell Data Contain With Char

1 view (last 30 days)
Tyann Hardyn
Tyann Hardyn on 21 Apr 2022
Commented: Deepak Gupta on 21 Apr 2022
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...

Accepted Answer

KSSV on 21 Apr 2022
fg = {'07-Apr-2022'; '08-Apr-2022'; '09-Apr-2022'};
ans = 3×1 datetime array
07-Apr-2022 08-Apr-2022 09-Apr-2022
Deepak Gupta
Deepak Gupta on 21 Apr 2022
Can you try
fg = datetime(fg,'InputFormat','dd-MMM-yyyy')

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!