MATLAB Periodic Table Activity
1. Click on the MatLab alias. After MatLab is open and the command window is
showing the prompt >>, type
load ptable
Next, type who
for a list of variable names, in this case the properties of the elements
which are available.
2. Now try plotting a single property vs. atomic number
plot(MeltingPt,'+g');
will give a plot of Melting point vs. atomic number.
a. To find a particular group, type
hold on; (this holds the current plot)
i=find(Group==1); (this will find Group 1 elements)
plot(i, MeltingPt(i),'or') (this will circle the group 1
elements in red on the plot)
b. Now try getting group 2 circled in yellow.
3. Try plotting a different property
hold off;
plot(Atomicrad, 'g');
Now try looking at the data a different way
load noble.dat; (a file of noble gas atomic numbers)
n=max(Atomicrad);
x=noble(:,2);
y=n*noble(:,1);
hold on;
plot(x,y,'r');
The red lines divide the graph into periods
Repeat the above steps for ionE
4. Try plotting some other properties.
5. You might try a 3 dimensional plot.
atno=[1:1:106];
plot3(atno,Atomicrad,ionE,'+y');
grid on;
Try comparing some other properties.
Program and Data Files
The program ( makeptab.m ) which reads all
the data files and sets up the variables. It saves the files then as ptable.mat . To download this formatted file
use the pop-up menu and Save this Link As option. This program is a MatLab
.mat file and can not be read directly as a text file. The makeptab.m file
is a straight text file.
The following programs each hold data of the listed type for the
elements. Units (if known) are given in the text at the top of the file.
These can be read directly, as they are text files.
And the file of data for drawing vertical lines at the noble gases
noble.dat .
Files have also been created which can be used to create a screen version
of the periodic table. The data file is
tabrec.dat and the file which reads it is
maketab.m . This second program creates a binary file tabrec.mat which, like the ptable.mat file,
needs to be saved as a source file from here.
Once the ptable.mat and tabrec.mat files are on the computer, the program
initTab.m can be run. This automatically
loads the two mat files and lists the avaliable properties. A Contents.m stored in the periodic table
folder or subdirectory functions as a help file.
Also available are 3 functions. printp.m
draws the periodic table using the tablrec.mat file while clickel.m allows the user to click on the
drawn table at the position of any element and display that elements
properties. surf2.m expects a Property name
and tabp and then plots a surface plot of that property.