필터 지우기
필터 지우기

Importing only a fraction of a database using dataset

조회 수: 1 (최근 30일)
Sebastiano delre
Sebastiano delre 2016년 5월 14일
댓글: Sebastiano delre 2016년 5월 15일
I have a large dataset in csv format (400MB). How can I import in MatLab only the first 500 rows?
  댓글 수: 1
Sebastiano delre
Sebastiano delre 2016년 5월 14일
Actually csvread does not work for me because my data contain not only numerical variables. I have also strings and cells. Is there a way I can use the function dataset?

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 14일
nc=6; % Number of column in your csv file
nr=500
data=csvread('file.csv',0,0,[0 0 nr-1 nc-1])
  댓글 수: 4
Walter Roberson
Walter Roberson 2016년 5월 14일
xlsread() accepts range arguments.
You have R2013b according to your other postings; you could consider readtable() . I do not know how fast that would be; I seem to remember later releases made it faster.
Sebastiano delre
Sebastiano delre 2016년 5월 15일
Actually I have R2014b now. readtable() works fine and it is very very fast. Thanks!

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

추가 답변 (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