matlab如何导入csv文件及matlab支持的数据格式,相应函数
2011-06-29 23:10
1756 查看
使用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 dlmread Double array.
Spreadsheet formats
XLS - Excel worksheet xlsread Double array and cell array.
WK1 - Lotus 123 worksheet wk1read Double array and cell array.
Scientific data formats
CDF - Common Data Format cdfread Cell array of CDF records
FITS - Flexible Image Transport System fitsread Primary or extension table data
HDF - Hierarchical Data Format hdfread HDF or HDF-EOS data set
Movie formats
AVI - Movie aviread MATLAB movie.
Image formats
TIFF - TIFF image imread Truecolor, grayscale or indexed image(s).
PNG - PNG image imread Truecolor, grayscale or indexed image.
HDF - HDF image imread Truecolor or indexed image(s).
BMP - BMP image imread Truecolor or indexed image.
JPEG - JPEG image imread Truecolor or grayscale image.
GIF - GIF image imread Indexed image.
PCX - PCX image imread Indexed image.
XWD - XWD image imread Indexed image.
CUR - Cursor image imread Indexed image.
ICO - Icon image imread Indexed image.
RAS - Sun raster image imread Truecolor or indexed.
PBM - PBM image imread Grayscale image.
PGM - PGM image imread Grayscale image.
PPM - PPM image imread Truecolor image.
Audio formats
AU - NeXT/Sun sound auread Sound data and sample rate.
SND - NeXT/Sun sound auread Sound data and sample rate.
WAV - Microsoft Wave sound wavread Sound data and sample rate.
相关文章推荐
- MySQL如何导入csv格式数据文件解决方案
- MySQL如何导入csv格式数据文件解决方案
- MySQL如何导入csv格式数据文件解决方案
- 如何批量导入基于Excel格式的数据文件
- oracle中如何将csv格式文件导入table
- 导入csv文件时,如果最后一列没有数据,读取出来的集合比抬头字段少,和数据中包含","如何处理?
- SQL : 一个存储过程,用于向指定的MS SQL Table中导入CSV 格式的文件数据
- java 导入Excel 文件,兼容Excel 2003(后缀名:xls)及 2007(后缀名:xlsx)的文件,同时还支持csv格式的文件
- 如何将mysql数据库的数据导出并转为.csv文件格式为UTF-8无BOM
- 将CSV格式的文件导入到数据中
- 在Java中如何读取用MATLAB的fwrite()函数写入文件的数据
- mysql如何导入csv格式数据
- MySQL批量导入数据SQL语句(CSV数据文件格式)
- csv格式的文件数据导入mysql指定的表中方法
- 如何将txt格式的数据导入到MATLAB中,并绘制图线
- 如何将 JSON, Text, XML, CSV 数据文件导入 MySQL
- 如何将 JSON、Text、 XML、 CSV 数据文件导入 MySQL
- php读取含有3w条以上数据的csv文件,并选择性将相应字段的数据导入至mysql
- mysql如何导入csv格式数据
- 如何用命令行导入csv格式的数据