WHS MatLab Mass Spec Demo

Mass Spec Activity

Updated 08/12/04

Sample activity sheet for "live" handling of the data file.

Mass Spectrometry Simulation for Atomic Abundances and Isotopes

Now that you have completed the mass spec simulation on the calculator, we can go one step further. We will use MATLab to simulate the output when a natural sample of an element is run through a mass spec. Follow the steps below:

1. Double click on the MATLab icon.

2. After the program opens, you will see a screen and the cursor will be positioned at a prompt that looks like this: >> Type clear and return.

3. Type load atom.dat; at the prompt. This loads a file which contains the atomic numbers, mass numbers, isotopic masses and isotopic abundances for elements 1-36.

4. Now type atno=atom(:,1); This pulls out all the atomic numbers. We will use this to select a particular atom.

5. Type mass=atom(:,3); to load the masses of each isotope and perc=atom(:,4); to load the percent abundances.

6. To select a particular element, type i = find(atno==#); but type a number between 1 and 36 instead of the number sign. For example, to see the spectrum for Magnesium, type i = find(atno==12); Elements of atomic numbers 17, 29, 30, 32, 34 and 35 should have interesting spectra, but you can try any between 1 and 36.

7. To plot the mass spec for an element, type the following: xleft=min(mass(i))-5; xrght=max(mass(i))+5; these 2 commands set the axis length bar(mass(i),perc(i)); the width of the bars is arbitrary. The position of the * at the bottom indicates the actual mass being plotted. axis([xleft xrght 0 100]); finishes the graph.

8. To get a cursor which will allow you to actually read values and print them out to the screen val=ginput(#) where # is the number of peaks on the graph. Position the cursor at the top of each bar, in line with the * and click. Continue until all peaks have been read.

9. To do another element, repeat steps 6 and 7. Do at least 3 elements.

10. Then, at the command prompt, type massspec. This will start a program which yields a better plot. All you need to enter is the atomic number and to type in the val=ginput(#) command. Do at least 5 elements with this.

Q: How does the atomic weight on the periodic table relate to the peaks observed?