Jake Bobowski
~Home~
SCI 266
jake.bobowski@ubc.ca
   UBCO

Here is a set of MATLAB scripts designed for the physics undergraduate. I am a MATLAB novice. These tutorials are not intended to cover everything task that you might encounter. However, I hope to add dcripts that cover many of the basic tasks that come up repeatedly.



BASICS
Preliminaries .m/.html
Operating on a list .m/.html
Merging lists .m/.html

SYSTEMS OF EQUATIONS
Linear and simple systems .m/.html
Nonlinear equations and systems
functions
.m/.html
nonlinfcn1.m
nonlinfcn2.m
nonlinsys.m

PLOTTING
Ploting data, formatting plots, saving plots
function
 
outputs
.m/.html
eps2pdf.zip
eps2pdf.m
formattedPlot.eps
formattedPlot.pdf
formattedPlot.jpg
Adding curves/data to existing plots .m/.html
Plotting a function .m/.html
Loglog and semilog plots .m/.html
Histograms
function
.m/.html
poisson.m
Surface plots .m/.html

FUNCTIONS
Symbolic functions in a script .m/.html
Creating functions to be called in other scripts
function files
 
 
all primes from 1 to 1e6
.m/.html
fact.m
quadrature.m
primes.m
primes_1e6.txt
A more "advanced" function
function file
largest number checked for "primeness"
all primes from 1 to 1e10 (compressed)
read me
.m/.html
primes_adv.m
primes_max.txt
primes_list.zip
read_me.txt

IMPORTING/EXPORTING DATA
Importing data
inputs
.m/.html
.txt import
Importing multiple files
inputs
.m/.html
file001data.txt
file002data.txt
file003data.txt
file004data.txt
file005data.txt
file008data.txt
file012data.txt
Exporting data
output
.m/.html
matrix data.txt

FITTING DATA
Weighted linear fit .m/.html
Weighted polynomial fit .m/.html
Weighted linear-in-parameters fit .m/.html
Weighted nonlinear fit .m/.html
Simultaneous nonlinear fits
files
.m/.html
nlinmultifit.m
S11 - real imag.dat

INTERPOLATING DATA
Interpolation
inputs
.m/.html
calibration data
experimental data

FOURIER TRANSFORMS
Fourier transform
inputs
.m/.html
squareWave.dat
fftData.dat

CONTROL STRUCTURES
For loops .m/.html
If statements .m/.html
While loops .m/.html
Nested structures .m/.html

MATRICES
Matrix basics .m/.html

DISCRETE CALCULUS
Discrete derivatives .m/.html
Discrete integrals .m/.html

NYQUIST SAMPLING
Reconstructing continuous functions .m/.html

IMAGE PROCESSING
Basics of image processing
input
output
.m/.html
30min.jpg
30min-enhanced.dat

MONTE CARLO BASICS
Monte Carlo Hit & Miss integration .m/.html
Monte Carlo f-average integration .m/.html
Volume of a sphere in d-dimensions
inputs
.m/.html
Wikipedia figure
Photomultiplier Tube (PMT) simulation .m/.html




created by Jake Bobowski,
jake.bobowski@ubc.ca

last modified: June 7, 2023

URL: https://cmps-people.ok.ubc.ca/jbobowsk/MATLAB.html

Giant Sequoia