CSV vs MAT files
Ältere Kommentare anzeigen
Should I store very large amount of data as .mat files or .csv. Which is more: (1) efficient when it comes to reading the data (2) more compressed in terms of size
4 Kommentare
Jason Ross
am 26 Mai 2011
Some questions:
- What is "a very large amount of data"? Each of us has our own definition ... some people might think in MB, others in GB, some in TB and some in PB.
- Is this a collection of large files or a collection of small files?
- Is this stored in a directory hierarchy or a collection of files?
- Will other applications have to access the data, or only MATLAB?
- Is this stored locally on the PC or on a network location?
Sean de Wolski
am 26 Mai 2011
Whoever here is think in PB you win! I think TBs are big.
Jason Ross
am 26 Mai 2011
Come on, a 2TB drive is $100 nowadays :). Of course, that's not enterprise class storage but it's fairly easy to fill up with virtual machine images and HD video (in a DVR, for instance). Or piles of data coming going into or out of something or other.
Sean de Wolski
am 26 Mai 2011
We take high resolution xmt scans, do all sorts of fun math on them, and we may fill a TB over the course of a year.
I do enjoy the reward of knowing that it is faster and (obviously) requires less space to recompute something than to store it and load it.
Akzeptierte Antwort
Weitere Antworten (3)
Sean de Wolski
am 26 Mai 2011
0 Stimmen
- If you're going to be using it outside of MATLAB -> CSV
- If you're only using it within MATLAB and you're motivating to writing/reading directly, then write it to binary using fwrite, and fread to pull it in. I used to do this, but got lazy and realized it's much easier even if slower to use MAT files
- If you're lazy and want something easy/the ability to store multiple variables at once -> .MAT
My suggestion after years of being angry at reading in a binary file with the wrong dimensions: use .mat files.
Sam Da
am 26 Mai 2011
0 Stimmen
2 Kommentare
Sean de Wolski
am 26 Mai 2011
Do you have 500GB of RAM? You won't be storing all 500GB in one mat file right? As long as your mat files don't exceed at least half the RAM you have, you should be fine. You can store more than that, but you won't be able to do anything with it without exceeding your RAM limit.
Walter Roberson
am 26 Mai 2011
You can append to existing .mat files, if you are adding new variables. (You cannot append to an existing variable except by rewriting the whole variable.)
Lisa Justin
am 18 Okt. 2012
0 Stimmen
i have a csv file and want to convert it to a matlab file. how can i do this?
1 Kommentar
Sean de Wolski
am 18 Okt. 2012
Lisa, Please ask a new question.
Kategorien
Mehr zu Historical Contests finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!