用matlab读csv数据_使用MATLAB读取CSV文件?

在尝试使用MATLAB的csvread函数在Linux系统中读取包含日期的CSV文件时,遇到了错误。问题在于csvread只能读取数值,无法处理日期字符串。解决方案是使用textscan函数,通过指定分隔符来正确读取数据。
摘要由CSDN通过智能技术生成

I am trying to read in a .csv file with MATLAB. Here is my code:

csvread('out2.csv')

This is what out2.csv looks like:

03/09/2013 23:55:12,129.32,129.33

03/09/2013 23:55:52,129.32,129.33

03/09/2013 23:56:02,129.32,129.33

On windows I am able to read this exact same file with the xlsread function with no problems. I am currently on a linux machine. When I first used xlsread to read the file I was told "File is not in recognized format" so I switched to using csvread. However, using csvread, I get the following error message:

Error using dlmread (line 139)

Mismatch between file and format string.

Trouble reading number from file (row 1u, field 2u) ==> /09/2013

23:55:12,129.32,129.33\n

Error in csvread (line 48)

m=dlmread(filename, ',', r, c)

I think the &

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值