フィルターのクリア

faster reading using csvread question

2 ビュー (過去 30 日間)
colors
colors 2017 年 5 月 22 日
回答済み: Matthew Eicholtz 2017 年 5 月 22 日
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

回答 (1 件)

Matthew Eicholtz
Matthew Eicholtz 2017 年 5 月 22 日
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);

カテゴリ

Help Center および File ExchangeActiveX についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by