Skip to content

janklab/FasterDatevec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FasterDatevec

An optimized version of datevec for Matlab.

FasterDatevec is part of the Janklab suite of libraries for Matlab.

Caution: Experimental Code

WARNING: This is pre-alpha-quality, experimental code. Do not use it for anything yet!

Overview

FasterDatevec is an attempt to provide an optimized version of Matlab's datevec() function which will run faster for common use cases (that is, dates in the range of about 1950-2050).

The optimized datevec function is called fastdatevec(). It has the exact same interface as datevec(), and can be used as a drop-in replacement for it.

Installation and Use

Download the FasterDatevec distribution, either by cloning the repo or downloading a release distribution from its Releases page.

Then get its Mcode/ directory on your Matlab path. No other setup is necessary. At that point, you can call fastdatevec().

To see examples of how it's used, or to test its performance on your system, use the jl.time.BenchFastDatevec tool.

Examples

% Convert datenums to datevecs

dnum = now;
dvec = fastdatevec(dnum)

dnums = now + 0:.3:2;
dvec = fastdatevec(dnums)

% Benchmark fastdatevec

b = jl.time.BenchFastDatevec;
rslt = b.bench

Author

FasterDatevec is written by Andrew Janke.

The project home page is https://github.com/janklab/FasterDatevec. Bug reports and feature requests are welcome there.

About

An optimized version of datevec for Matlab

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published