How to insert date and time data into a matrix?

I have a big csv file which I imported it in matlab. The columns have the variables: name surname address date time . I want to insert them in a matrix. I tried to run this: A=[ name surname address date time ] but I couldn't. In the command window it is written the following:" Error using datetime/horzcat (line 1217) All inputs must be datetimes or date/time strings." What shall I do?

回答 (1 件)

Peter Perkins
Peter Perkins 2017 年 11 月 16 日

0 投票

This is what tables (or in your case, probably, timetables) are for: mixed-type data. In recent versions of MATLAB, you should be able to use readtable and get what you want in one line.

カテゴリ

ヘルプ センター および File ExchangeTime Series Objects についてさらに検索

質問済み:

2017 年 11 月 2 日

回答済み:

2017 年 11 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by