How can I trim a dataset with missing values

1 次查看(过去 30 天)
I have a dataset I'm working on as part of a project. I need to trim it down for some specific information, but I can't figure out how to go about it, as it's too much data to manually manipulate.
Essentially I have 2 columns with information. The first column holds a date and time in various formats. I need each cell to be the time only.
example:
05/07 2008 13:40 --> 13:40 --> 13.40
11.01.2009 15.12 --> 15.12
Is there a way to do this in matlab? (I was thinking regex but I'm not very experienced in that)
The second column simply holds either a 1 or a 0. The problem here is that I need both columns for each row, or I have to discard the data. Is there a way to automatically delete rows, for which there's less than 2 columns of data?
Thanks in advance.
  2 个评论
Guillaume
Guillaume 2016-11-3
Yes, you could use a regular expression to extract your time, but for us to tell you which expression to use we would need to know what are all the possible formats we have to deal with.
As for your second question, the answer again is yes, but to answer it properly we need to know what form your data is in at the moment. How can there be less than two columns of data for some rows if everything is stored in a cell array?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by