matlab可以csv文件格式,matlab如何导入csv文件及matlab支持的数据格式,相应函数

使用csvread函数读取

M = csvread('filename')

M = csvread('filename', row, col)

M = csvread('filename', row, col, range)

输出用:

csvwrite('filename',M)

csvwrite('filename',M,row,col)

实际使用时importdata()函数比较方便,从Excel另存数据为"csv"文件,matlab在读取时容易产生如下错误:

??? Error using ==> dlmread at 145

Mismatch between file and format string.

Trouble reading number from file (row 1, field 2) ==> " -0.

Error in ==> csvread at 52

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

Data formats                     Command    Returns

MAT  - MATLAB workspace         load       Variables in file.

CSV  - Comma separated numbers  csvread    Double array.

DAT  - Formatted text           importdata Double array.

DLM  - Delimited text           dlmread    Double array.

TAB  - Tab separated text       dlmre

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值