3.7
(3)
今天来说下如何使用Matlab读取excel的csv文件,这个有什么用呢?想必理科生大概率都会用到示波器,去抓取一些电信号或者光信号,我们从示波器导出来的就是csv文件或者图片文件,而图片文件我们无法处理。所以,一般导出csv文件,可以用Matlab去处理数据。
Matlab帮助文件
Matlab自带了一个函数csvread来读取csv文件,关于这个函数的用法,可以在Matlab命令行窗口输入如下命令获取该函数的帮助信息:help csvread
得到结果如下:csvread Read a comma separated value file.
M = csvread(‘FILENAME’) reads a comma separated value formatted file FILENAME. The result is returned in M. The file can only contain numeric values.
M = csvread(‘FILENAME’,R,C) reads data from the comma separated value formatted file starting at row R and column C. R and C are zero-based so that R=0 and C=0 specifies the first value in the file.
M = csvread(‘FILENAME’,R,C,RNG) reads only the range specified by RNG = [R1 C1 R2 C2] where (R1,C1) is the upper-