x = EmpiricalFormula()
x = EmpiricalFormula('H2O')
x = EmpiricalFormula(struct('H', 2, 'O', 1))
Jonathan, I think this could be a useful piece of code, but you have not documented it. If you have gone to the effort of writing and shareing the code, I suggest going the extra effort to document it so others might be interested in using it.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.