简体   繁体   English

在Matlab中将具有多种类型的CSV文件导入2D数组

[英]Importing a csv file in Matlab with multiple types into a 2D array

I am trying to import a CSV file in Matlab. 我正在尝试在Matlab中导入CSV文件。 The file contains integers, floats and a timestamp of the time taken. 该文件包含整数,浮点数和所用时间的时间戳。 csvread or dlmread do not do the trick due to mixed file types. 由于文件类型混合,csvread或dlmread不能解决问题。 On the other hand I tried textscan as suggested here but the whole data is put into a Nx1 array (with N being the number of lines in the csv file. The data is EEG data that I wish to perform some band bass filtering to it, but first I need to read the file in a 2D array. Any ideas? PS I am using Matlab R2013a 另一方面,我按照此处的建议尝试了textscan,但是整个数据都放入了Nx1数组中(其中N是csv文件中的行数。该数据是EEG数据,我希望对其进行一些低音低音过滤,但是首先我需要读取2D数组中的文件,有什么想法吗?PS我正在使用Matlab R2013a

Example file can be found here 示例文件可以在这里找到

If you can not use Excel, this Question is a duplicate (comment of Eitan). 如果您不能使用Excel,则此问题是重复的(Eitan的评论)。 Otherwise I would recommend to use xlsread, this uses excel com interface and is able to read everything excel can read. 否则,我建议使用xlsread,它使用excel com界面,并且能够读取excel可以读取的所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM