A collection of fundamental physical constants in various unit systems for MATLAB.
This software is licensed under the GNU General Public License (version 3).
- MATLAB R2013b - R2018a
v=Constant.NameOfConstant returns the value of the named constant in the default unit system. See the list of physical constant names. For examples:
v=Constant.ElementaryChargereturns the value of the elementary charge, e;v=Constant.LightSpeedreturns the value of the speed of light, c.
By default, the values are returned in the SI units. To set a different unit system as default, do one of the following:
- Make a variable assignment:
UnitSystem='UnitSystemCode';, whereUnitSystemCoderefers to the unit system to be used. See the list of unit system codes. - Define an anonymous function:
UnitSystem=@()'UnitSystemCode';. - Create a function named
UnitSystemin the current working directory or elsewhere. The function takes no input arguments and returns a string specifying the unit system code.
v=Constant.UnitSystemCode.NameOfConstant returns the value of the named constant in the specified unit system, regardless of the default unit system. For examples:
v=Constant.SI.ElementaryChargereturns the value of the elementary charge, e, in the SI units (=1.602176565);v=Constant.P.LightSpeedreturns the value of the speed of light, c, in the Planck units (=1).
[v,u]=Constant.NameOfConstant and [v,u]=Constant.UnitSystemCode.NameOfConstant additionally return the uncertainty of the named constant.
HA: Hartree Atomic UnitsP: Planck UnitsQCD: Quantum Chromodynamics UnitsRA: Rydberg Atomic UnitsS: Stoney UnitsSI: International System of Units
AtomicMass: atomic mass unit, muAvogadroNumber: Avogadro's number, NABohrMagneton: Bohr magneton, μBBohrRadius: Bohr radius, a0Boltzmann: Boltzmann constant, kBConductanceQuantum: conductance quantum, G0Coulomb: Coulomb constant, keElectronMass: electron mass, meElementaryCharge: elementary charge, eFaraday: Faraday constant, FFermiCoupling: Fermi coupling constant, GF/(ħc)3FineStructure: fine-structure constant, αFluxQuantum: magnetic flux quantum, Φ0Gravitational: Newtonian constant of gravitation, GHartreeEnergy: Hartree energy, EhLightSpeed: speed of light, cLoschmidt: Loschmidt's number, n0NuclearMagneton: nuclear magneton, μNPlanck: Planck constant, hProtonMass: proton mass, mpReducedPlanck: reduced Planck constant, ħRydberg: Rydberg constant, R∞StefanBoltzmann: Steffan-Boltzmann constant, σVacuumImpedeance: vacuum impedance, Z0VacuumPermeability: vacuum permeability, μ0VacuumPermittivity: vacuum permittivity, ε0WienDisplacement: Wien displacement law constant, b