How to import csv file of 200 rows by 4096 columns without truncation?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Derrick Tiew
am 2 Jun. 2014
Kommentiert: Derrick Tiew
am 2 Jun. 2014
I am facing a problem trying to read in a csv file of 200 rows by 4096 columns. I have tried the following commands to read in the file: csvread, xlsread, load However, each time I noticed that I was only able to read in 200 rows by 256 columns to a data array. When I did a preview of the csv file in Matlab, I saw the message 'Preview truncated at twenty thousand characters'. If the number of rows is only 100 rows, then the number of columns that I am able to read in is 2048. It seems that there is a limit to the number of data values that Matlab will be able to read in from a file. May I know if there is a way to extend the memory space of Matlab so that I can read in data values from a csv file with more than 200 rows by 4096 columns?
0 Kommentare
Akzeptierte Antwort
Niklas Nylén
am 2 Jun. 2014
3 Kommentare
Niklas Nylén
am 2 Jun. 2014
Bearbeitet: Niklas Nylén
am 2 Jun. 2014
To me it sounds like it is only the preview that is truncated, not the data itself.
This works for me:
% Write a csv file with random values, size 200*4096
x = rand(200,4096);
csvwrite('test.csv',x)
a = csvread('test.csv');
b = importdata('test.csv');
Except for small rounding errors, x, a and b are identical:
>> max(max(abs(x-a)))
ans =
5.0000e-006
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!