How can I read an Excel spreadsheet into a Matlab table and not have the storage requirement for the table increase by a factor of 10 over the Excel file size?
1 view (last 30 days)
Show older comments
I have Excel spreadsheets of size 57MB, 220MB, and 136MB. When I use "readtable" to read these spreadsheets, the table size is 5.1GB, 18.7GB, and 11.4GB, respectively, which are too large to effectively use in Matlab. Obviously, I can just not use the table data structure, but is there a way of reading a spreadsheet into a Matlab table without increasing the storage requirement so drastically?
Here is the code: file = 'S:\IM\CSN Files\FOR DR.SINCOVEC\NCHEMS\dbo_NCHEMS_uno.xlsx' T = readtable(file); save('NCHEMS_UNO_DATA', 'T', '-v7.3')
All these spreadsheets have 53 columns with the largest having about 814,800 rows.
0 Comments
Answers (1)
Peter Perkins
on 16 Mar 2017
It's likely that you're reading in text data. Consider using categorical variables and datetimes in the table. readtable has had features added over several releases, so it's hard to give specifi advice without knowing what release you're on. ImportOptions is a recent addition that should help.
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!