faster reading using csvread question
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have a csv file that looks like the below
_TYPE_ _NAME_ a b c d date
CRR a 1 0.778220822 0.711397234 0.29490149 4/30/2017
CRR b 1 0.778220822 0.711397234 0.29490149 4/30/2017
CRR d 1 0.778220822 0.711397234 0.29490149 4/30/2017
CRR e 1 0.778220822 0.711397234 0.29490149 4/30/2017
I would like to store the numeric values column a-d as a matrix the date column as a separte variable in form of a vector the name column as a separate variable in form of a vector.
the number of numeric columns can differ in this above example it is only 4 , but you can have varying number of columns, the last column is always the date and the first two columns are always type and name
I have been using xlsread for this but was wondering if there is a faster way using csvread or some other function
many thanks for your help
0 Commenti
Risposte (1)
Matthew Eicholtz
il 22 Mag 2017
Have you tried readtable? I haven't run any timing diagnostics to see which is faster, but that could be another option for you to try.
Here's an example function call:
T = readtable(filename,'Delimiter',',','ReadVariableNames',true);
0 Commenti
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!