Mathematics Previous page   Next Page

Column-Oriented Data Sets

Univariate statistical data is typically stored in individual vectors. The vectors can be either 1-by-n or n-by-1. For multivariate data, a matrix is the natural representation but there are, in principle, two possibilities for orientation. By MATLAB convention, however, the different variables are put into columns, allowing observations to vary down through the rows. Therefore, a data set consisting of twenty four samples of three variables is stored in a matrix of size 24-by-3.

Vehicle Traffic Sample Data Set

Consider a sample data set comprising vehicle traffic count observations at three locations over a 24-hour period.

Vehicle Traffic Sample Data Set  
Time
Location 1
Location 2
Location 3
01h00
11
11
9
02h00
7
13
11
03h00
14
17
20
04h00
11
13
9
05h00
43
51
69
06h00
38
46
76
07h00
61
132
186
08h00
75
135
180
09h00
38
88
115
10h00
28
36
55
11h00
12
12
14
12h00
18
27
30
13h00
18
19
29
14h00
17
15
18
15h00
19
36
48
16h00
32
47
10
17h00
42
65
92
18h00
57
66
151
19h00
44
55
90
20h00
114
145
257
21h00
35
58
68
22h00
11
12
15
23h00
13
9
15
24h00
10
9
7

Loading and Plotting the Data

The raw data is stored in the file, count.dat.

Use the load command to import the data.

This creates the matrix count in the workspace.

For this example, there are 24 observations of three variables. This is confirmed by

Create a time vector, t, of integers from 1 to n.

Now plot the counts versus time and annotate the plot.

The plot shows the vehicle counts at three locations over a 24-hour period.

plot of time on the x axis versus vehicle count on the y axis for three locations


Previous page  Data Analysis and Statistics Basic Data Analysis Functions Next page

© 1994-2005 The MathWorks, Inc.