MATLAB Files developed for Math 151-2 Course in Mathematics
for Life Science Students
These files are to aid you in doing problems in this course.
The below list is a brief description of what each .m file does:
lesson1.m Plots leaf length and width histograms from data in l
and w as well as graphs length vs. width
lesson2.m Compares plots of leaf length and width and regressions
of these for two different data sets: l and w vs. l3
and w3 stored in file leafstat.dat
lesson3.m Using data on fat intake and artherosclerosis death rate
in Norway, computes the regression line and correlation
coefficient
lesson3b.m Using data in correlat.mat this illustrates difference in
linear regression when graphing x against y rather than y
against x.
lesson3c.m Using data in semilog.dat this illustrates the ability to do
a linear regression on a semilog plot
lesson3d.m Using data in loglog.dat this illustrates the ability to do
a linear regression on a loglog plot
lesson4.m Using data in co2dat.sh which gives Maona Loa atmospheric
CO2 concentration annual averages from 1970-1990, this
computes linear regression and estimates CO2 in years
2000 and 2100.
co2plot.m Using data in co2datmo.dat which gives Maona Loa atmospheric
CO2 concentration monthly data from 1965-1970, this just
show plot to illustrate heartbeat of the planet.
lesson5.m This illustrates eigenvalues and eigenvectors arising from
a population projection model. It compares growth rate as
measured by the eigenvalue to that from projecting the
population forward 10 and 20 time periods.
binomial.m Simulates a binomial distribution corresponding to
coin tosses and compares theoretical mean and variance
to that simulated.
coints.m Simulates n tosses of a coin with probability p
of getting a Head and 1-p of getting a Tail
ordersta.m Simulates tosses of a coin with probability p
of getting a Head and 1-p of getting a Tail and counts the
time until the kth Head occurs. That is, this computes
the kth order statistics.
urn.m Simulates an urn with two-types of balls (1 and 2) and the
rules are: choose a ball, replace the ball with itself and one
other of the same type, repeat process. A Polya-urn scheme.
levelcrs.m Simulates tosses of a coin with probability p of getting
a Head and 1-p of getting a Tail and counts the time
until either the kth Head occurs or the mth Tail. A level-
crossing problem.
level2.m Simulates tosses of a coin with probability p of getting
a Head and 1-p of getting a Tail and determines the fraction
of experiments in which k heads occur before m tails occur.
Another level crossing example.
exponen.m Solves the discrete logistic equation x(i+1)=a*x(i)+b
analog.m Solves the discrete analog of the continuous logistic
growth model x(i+1)=r*x(i)/(1+x(i))
logistic.m Solves the discrete logistic equation x(i+1)=r*x(i)*(1-x(i))
selectio.m Simulates selection in a one locus two allele model, with
random mating, infinite population size, no mutation
secdiff.m Solves general homogeneous second order difference equations
of the form a x(n+1) + b x(n) + c x(n-1) = 0