필터 지우기
필터 지우기

Efficient way to read in large dataset

조회 수: 2 (최근 30일)
Mads
Mads 2011년 11월 1일
Hi all.
I am to read in a set of data to Matlab which has 6 columns and more than 2 million rows. I tried reading the data as a tab delimited .txt file with the dataset function as such:
pricedata = ...
dataset('File',file,'Delimiter','tab','ReadObsNames',true) ;
This has gone on for more than 3 hours. Can someone suggest a better way to do it?

채택된 답변

Peter Perkins
Peter Perkins 2011년 11월 1일
Mads, you will most likely find that this:
>> help dataset/dataset
dataset Create a dataset array.
[snip]
DS = dataset('File',FILENAME,'Format',FORMAT, ...) creates
a dataset array using the TEXTSCAN function to read column-
oriented data in a text file. Specifying a format can
improve speed significantly for large files.
will read the file much faster. In your case, FORMAT might be something like '%f%f%f%f%f%f' if all the columns are numeric. Hope it helps.
  댓글 수: 1
Mads
Mads 2011년 11월 1일
Thx, I will give that a shot.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by