Code covered by the BSD License  

Highlights from
Data Analysis with MATLAB Products - August 2006 Webinar Files

image thumbnail

Data Analysis with MATLAB Products - August 2006 Webinar Files


Stuart Kozola (view profile)


14 Aug 2006 (Updated )

Files used in the August 10, 2006 Webinar of same title

function [X,A,C,T] = getSeatData(fileNameBase,showplot)
%GETSEATDATA   Load Filtered Seat Vibration Data
%  GETSEATDATA reads the MS Excel formatted version of Seat Vibration Data
%  specified in FILENAMEBASE, filters the data according to the filter defined
%  by myLPFilter.  FILENAMEBASE is the basic file name witout numbers (i.e.
%  seatvib_config1 will load in all data for files named
%  seavib_configXX.xls where XX is the numeric extention.
%  Syntax:
%  [X,A,C,T] = getSeatData(fileName) returns the filtered signals
%  displacement and acceleration into X and A, repectively.  C is
%  controller force signal.  T is the time.
%  See Also:    xlsread, filter, myLPFilter, plotSeatVib

%% Search the Directory for Files
% fileNameBase is the search string
D = dir([fileNameBase,'*']);

%% Start Looping for each File
for i = 1:length(D)
    fileName = D(i).name;
%% Load in the numeric data in Filename
    num = xlsread(fileName);

%% Parse the Numeric Data into appropriate variables
    % Data is in the form: Time, displacement, acceleration, control_Force.
    % Text Labels are in the first row, so numeric data starts in row 2.
    T(:,i) = num(:,1);
    Xraw(:,i) = num(:,2);
    Araw(:,i) = num(:,3);
    C(:,i) = num(:,4);

%% Filter Displacement and Acceleration
    % Use the myLPFilter definition to filter the data.
    X(:,i) = filter(myLPFilter,Xraw(:,i));
    A(:,i) = filter(myLPFilter,Araw(:,i));

%% Plot the Raw and Filtered Data
% Use the plotSeatVib function to show the data.
if sum( showplot == i )

%% Stop Looping

Contact us