A very simple class to hold physical and mathematical constants and unit conversion methods.
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.
A recent version of Matlab is needed to run the code. The code has been developed in Matlab 2016a Academic version.
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
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.
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..
Copyright (c) 2017 Mario Merino. The software is released as open source with the MIT License.