How do I extract numbers from a textscan?

I need to read a file with lines of data in the following format:
15:52:35.375,0.000,0.606,-0.820,-1,31.400,0.000,0
I am using textscan as follows to parse the data:
C = textscan(A, '%d:%d:%f,%f,%f,%f,%d,%f,%f,%d');
My results look like:
[15] [52] [35.375] [0.000] [0.606] [-0.820] [-1] [31.400] [0.000] [0]
I'm interpreting this output to mean that C is a vector of vectors. Is that correct? How do I convert it to a vector of numbers?

 采纳的回答

c is a cell array. convert it to double
c=cell2mat(c)
look at
help cell

1 个评论

Thank you. That worked, except that I cannot convert the entire row at once because I have mixed number types.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Large Files and Big Data 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by