process data from csv file
1 次查看(过去 30 天)
显示 更早的评论
Hi to all. I am trying to process data from a csv file using matlab. The csv file is like below:
Time, Value
1400660853.068, 614
1400661093.002, 641
1400661332.698, 599
So we have the first line as header and the rest of the first and second columns as data. I am interested in the second column which is the value. I would like to get the column as a matrix(not include the header). How could I do that? I tried to use the textscan command as below:
_clear;
close all;
fid=fopen('C:\Users\yyao\Desktop\Luminance_18.csv');
out=textscan(fid,'%f %d','delimiter',',');
date=out{2}
fclose(fid);_
But then I got date = Empty matrix: 0-by-1
Is there anything wrong with my codes? Thanks so much for helping!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!