Slicing elements in a cell array

22 ビュー (過去 30 日間)
Viral Solanki
Viral Solanki 2015 年 3 月 10 日
編集済み: per isakson 2015 年 3 月 11 日
Hello,
I have a cell array with elements inside in the following format:
temp = {'1990-01-02T00:00:00';'1990-01-01T00:00:00';'1990-01-03T00:00:00'}
What's the easiest way to slice each element so I get
ans =
'1990-01-02'
'1990-01-01'
'1990-01-03'

採用された回答

per isakson
per isakson 2015 年 3 月 11 日
編集済み: per isakson 2015 年 3 月 11 日
"What's the easiest way" &nbsp This approach is one candidate
>> datestr(datenum(temp,'yyyy-mm-ddTHH:MM:SS'), 'yyyy-mm-dd')
ans =
1990-01-02
1990-01-01
1990-01-03

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by