Outline
The Matlab environment Variables Arrays Scripts and functions Plotting
Matlab Tutorial
September 25, 2007
The Matlab Environment
Path Current Directory
myVar = 42;
>
Remember.
. make s
Physics 257: Experimental Methods I Syllabus Course Description Experimental Methods I. (Corequisite: PHYS230 or PHYS251!). Introductory laboratory work and data analysis with a focus on experiments
Bar Length Measurements
25
Mean = 152.1 mm
Number of measurements
Measurements from first lecture
20
Std. dev = 0.34 mm
15
10
5
0 151
151.2
151.4
151.6
151.8
152
152.2
152.4
152.6
152.8
153
Length of
Important Probability Distributions in Physics
Binomial Distribution
Generally applies to experiments in which the result can be one of only a small number of possible outcomes/final states
Permutat
Instrumental vs. Statistical Uncertainties
Instrumental uncertainties
Fluctuations in the reading of a measurement instrument to determine
Length, mass, voltage, current etc.
Statistical Fluctuatio
Understanding ChiSquared
2 =
reduced 2 =
yi f ( xi ; ai ) i i =1
N
2
2
DOF
=
1 N M
i =1
N
yi f ( xi ; ai ) i
2
Performing a LeastSquares Fit and Understanding the Result
A complete example
Con
CHAPTER
where
till'
index k runs lrou: I lOllI,
III
luct.
Wl'
cun gcncrulizc the method even fur
7
LEASTSQUARES FIT TOA POLYNOMIAL
ther by writing I':qualillil (7,2) as
f I'
y(x)
=
2: akfi:(x)
k=l
/
Admin Items
Lecture 6: Nonlinear Curve Fitting
Oct. 28 Last regular lecture. Assignment 7 will Oct. regular be posted. No lecture on Nov. 4, but the final assignment will No be posted (Assignment 8)!
Timevarying signals
Physics 257 Lecture 7: Basic TimeSeries Analysis: Introduction to the Fourier Transform
Prof. M. Dobbs, Physics 257 Nov 6. 2008
2
Timevarying signals
Time Domain Waveform
A time
Lab 5. Fictitious Forces in a Rotating Reference Frame: The Coriolis and Centrifugal
Forces
Laboratory Report
Presented To : Professor Bradley Siwick
Presented by: Chlo Robeyns, Juliann Wray and Rowan
Lab5part1
20171107, 1(40 PM
LAB 5: The Coriolis and Centrifugal Forces
Chlo Robeyns, Juliann Wray and Rowan Alghamdi
In [9]: import numpy
import matplotlib.pyplot as plt
import scipy.optimize as
Dr. Dobbs' Howto: Create a scatter plot in Matlab
This howto document walks you through the creation of an xy scatter plot, and drawing a line through it in Matlab. 1. Open matlab. Start All Programs
Physics 257 Lecture 1: Error Propagation & Matlab
Prof. Matt Dobbs
Physics Department, McGill U.
TA Office Hours
The TAs are there to help you. use them! Lab TAs
You may see these TAs during their of
Physics 257 Lecture 0: Basic Statistics & Introduction to Matlab
Prof. Matt Dobbs
Physics Department, McGill U.
Outline
Orientation session was yesterday, Sept 6. If you missed it, download the infor
Physics 257 Experimental Methods Orientation Session
Introductory laboratory work and data analysis as related to mechanics, optics and thermodynamics. Introduction to computers as they are employed f
Admin Items
Physics 257 Lecture 8: Review (selected topics only)
Prof. Matt Dobbs
Physics Department, McGill U.
Grades for all assignments and labs will be available within a week on WebCT. Online M
Math 222 Assignment 3
dt 1. Recall that sin1 x = 0x 1t2 . Use the binomial theorem and this integral to find the Maclaurin expansion of sin1 x.
2. Find a unit vector perpendicular to both v = 3i
Mathematics 222 Assignment 1
1 1. Does the sequence bn = sin( + n ) converge or diverge? If it converges, 2 what is the limit?
2. Does the sequence bn = n cos(n) converge or diverge? If it converges
Dr. Dobbs' Howto: Interface Matlab to Excel
(so you can format pretty looking tables for your lab reports)
Matlab is an ideal tool for making great looking plots, charts, and graphs easily. It is not
Summary from last week
Physics 257 Lecture 8: Fourier Transform
Prof. Matt Dobbs
Physics Department, McGill U.
Numerical minimizations of
=
2 i
( yi  f ( xi ; ai ) )2
yi
2
yields the best fit p
Admin Items
Physics 257 Lecture 6: Curve Fitting
Prof. Matt Dobbs
Physics Department, McGill U.
November 8 Last "regular" lecture. November 15 Last lecture (democratic)
We will do 2/3 of the follow
Physics 257 Lecture 2: Probability ( & yet more matlab )
Prof. Matt Dobbs
Physics Department, McGill U.
Important Topics from Last Lecture
Covariance (from last week)
s xy =
( x  x )( y
i i
i

Gaussian Distribution
Physics 257 Lecture 3: Least Squares Fit
Prof. Matt Dobbs
Physics Department, McGill U.
Question from last class: where does the Gauss distribution come from? Used in the 1730s
Outline
Physics 257 Lecture 4: 2
Prof. Matt Dobbs
Physics Department, McGill U.
Questions ? Comments from Assignment and Lab reports.
Be careful not to round off numbers in intermediate calculations
Opinion Polls
Physics 257 Lecture 5: More fun with Matlab
Prof. Matt Dobbs
Physics Department, McGill U.
Question from a student how do we interpret:
The poll surveyed 1,002 Quebecers from Oct. 10
Lab 3. Kater's Pendulum and a Precise Value of G
Laboratory Report
Presented To : Professor Bradley Siwick
Presented by: Chloe Robeyns and Juliann Wray
For : PHYS 257 Experimental Methods 1
Department