file store different type of data
Ältere Kommentare anzeigen
hi,
is there way by which can store different type of data such as:
ex. 234,'2005-07-21' 165 ,'2006-08-21'
I want avoid use datnum , because it is slow the running if I have huge data
thanks
Antworten (1)
the cyclist
am 12 Jan. 2012
0 Stimmen
Two things you should know:
- You can store mixed data types in a cell array: You might start with "doc cell" to get you started looking at the documentation.
- The datenum() function is much, MUCH faster if you use the second input argument, in which you specify the format of the strings that are going in.
2 Kommentare
huda nawaf
am 12 Jan. 2012
the cyclist
am 12 Jan. 2012
Yes. Try this test:
d = repmat({'2005-09-06'},[100000 1]);
tic;
dn1=datenum(d); % about 23s on my machine
toc
tic;
dn2=datenum(d,'yyyy-mm-dd'); % about 0.5s on my machine
toc
Kategorien
Mehr zu Dates and Time 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!