Skip to content

Instantly share code, notes, and snippets.

@jckantor
jckantor / molweight.m
Created January 15, 2014 03:41
Calculate the molecular weight of a species given a chemical formula.
function mw = molweight(varargin)
% MOLWEIGHT Computes the molecular weights for a set of chemical species.
%
% SYNTAX
%
% mw = molweight(formula)
% mw = molweight(species)
% mw = molweigth(r)
%