/constants_and_units

A very basic matlab class to hold physical and mathematical constants, and unit conversion factors

Primary LanguageMATLABMIT LicenseMIT

CONSTANTS_AND_UNITS

DOI

A very simple class to hold physical and mathematical constants and unit conversion methods.

Installation

Installation requires simply that you download CONSTANTS_AND_UNITS and add the base directory (the one that contains the +constants_and_units directory) to your Matlab path.

Dependencies

A recent version of Matlab is needed to run the code. The code has been developed in Matlab 2016a Academic version.

Usage

A constants object is created and used as in the following simple example:

c = constants_and_units.constants; % Create the object
c.eV2J(3); % Convert 3 eV to J

Testing

Unit tests are found in the /test subdirectory. After adding the package to your Matlab path, you can run all tests by executing runtests from this subdirectory.

Contributing

If you have any comments for improvement or are interested in contributing to the continued development of this or any of my other codes, you can contact us through our website.

For updates and news, follow us on Twitter: @ep2lab..

License

Copyright (c) 2017 Mario Merino. The software is released as open source with the MIT License.