Code covered by the BSD License
-
analyseExperimentalData(inFil...
analyseExperimentalData :
-
comparePendulumToSHM(x0,k,m)
comparePendulumToSHM : compare the motion of a simple harmonic oscillator
-
makeSincMovie
Copyright 2008-2009 The MathWorks, Inc.
-
pendulumDE(tVals,omega0,start...
Copyright 2008-2009 The MathWorks, Inc.
-
pendulumDataSimulated(x0, pen...
Generate simulated pendulum data and write this to an Excel spreadsheet.
-
pendulumFitFunction(t,y,param...
pendulumFitFunction : returns the fit value of pendulum model to
-
pendulumSimulation(x0,g,len)
pendulumSimulation : Simulation of pendulum
-
plotFrequencySpectrum(sampleF...
Plot the frequency spectrum of simple harmonic motion
-
plotTimeSeries(res)
Plot the time series representation of simple harmonic motion
-
readExperimentalData(inFileNa...
readExperimentalData : Read in the pendulum experiment data from an Excel
-
shmDataSimulated(x0, springCo...
Generate simulated pendulum data
-
shmSimulation(x0,k,m)
Simulation of SHM with spring constant k and mass m
-
lecture_1_mmcd.m
-
View all files
from
MATLAB in Physics - Visualisation
by Matt McDonnell
The first lecture in a series on using MATLABĀ® in undergraduate physics courses.
|
| readExperimentalData(inFileName)
|
function res = readExperimentalData(inFileName)
% readExperimentalData : Read in the pendulum experiment data from an Excel
% spreadsheet.
% The spreadsheet data is of the form:
% Time Position Velocity
% 0 1.57084162 -0.000789374
% 0.049974509 1.521674038 -1.973848125
% 0.099949019 1.373449177 -3.93452411
% 0.149923528 1.129514124 -5.8238293
% ...
% Copyright 2008-2009 The MathWorks, Inc.
% $Revision: 35 $ $Date: 2009-05-29 15:27:34 +0100 (Fri, 29 May 2009) $
% xlsread by default returns the matrix of numeric data starting at the top
% left hand corner of Sheet 1 of the workbook. When more output arguments
% are supplied it will also return the text data (here column headings) and
% the raw data (both text and numeric data returned as a cell array of
% strings). The general form of a call to xlsread is:
% [numericData, textData, rawData] = xlsread(inFileName,<more options>);
% where <more options> are described by 'help xlsread' or 'doc xlsread'
% Here we are just interested in the numeric data so only call with a
% single output argument:
numericData = xlsread(inFileName);
% Extract the columns of the numeric data array into fields of a structure.
res.Time = numericData(:,1);
res.Position = numericData(:,2);
res.Velocity = numericData(:,3);
|
|
Contact us at files@mathworks.com