Create a mass spectrum from loaded atom probe data and optionally identify ions. Use when the user wants to see or analyze a mass spectrum.
Create a mass spectrum from the pos variable in the MATLAB workspace. Use the MATLAB MCP server.
spec = massSpecPlot(pos, 0.01, 'normalised');
Use bin width 0.01 Da and normalised mode by default. If the user requests different settings, adjust accordingly.
If the user specified elements as $ARGUMENTS, add ion markers for each element. For each element, try common charge states (typically 1+ and 2+ for most elements, 3+ for transition metals):
ionAdd(spec, 'Fe', 2, isotopeTable, colorScheme);
ionAdd(spec, 'Fe', 1, isotopeTable, colorScheme);
If no elements are specified, just show the spectrum and ask the user which elements they expect in their sample. Suggest looking at the major peaks for identification.
Tell the user:
/apt-spectrum element1 element2, or define ranges with rangeAddAllisotopeTable and colorScheme must be in the workspace (from /apt-setup)load('isotopeTable_naturalAbundances.mat');
load('colorScheme_default.mat');