{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab10 comp

# Lab10 comp - Name Ryan Corley Section 4 Problems for the...

This preview shows pages 1–6. Sign up to view the full content.

1 Name: Ryan Corley Section: 4 Problems for the first stat lab. Data files are located on-line. Problem A Olympic Track Records and Basic Operations Part 1: Loading Data The following files contain data representing the winning Olympic times for the men and women's 400-m race. Men's Times (1896-1988) are in mensRecords.xls Women's Times (1964-1988) are in womensRecords.txt Load and store these data sets into Matlab. m=xlsread('mensRecords.xls') m = 1.0e+003 * 1.8960 0.0542 1.9000 0.0494 1.9040 0.0492 1.9060 0.0532 1.9080 0.0500 1.9120 0.0482 1.9200 0.0500 1.9240 0.0476 1.9280 0.0478 1.9320 0.0462 1.9360 0.0465 1.9480 0.0462 1.9520 0.0459 1.9560 0.0467 1.9600 0.0449 1.9640 0.0451 1.9680 0.0439 1.9720 0.0447 1.9760 0.0443 1.9800 0.0446 1.9840 0.0443 1.9880 0.0439 w=load('womensRecords.txt') w = 1.0e+003 * 1.9640 0.0520 1.9680 0.0520 1.9720 0.0511 1.9760 0.0493 1.9800 0.0489 1.9840 0.0488 1.9880 0.0486 Part 2: Basic Data Manipulations and Calculations 1 MAP2480, Fall 2008 Coordinator: Dr. Monica K. Hurdal ([email protected])

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
a)Plotting Make use of the three plot commands (scatter, bar and usual plot) to display the men's Olympic records. plot(m(:,1),m(:,2),'go') 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 42 44 46 48 50 52 54 56 scatter(m(:,1),m(:,2)) 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 42 44 46 48 50 52 54 56 bar(m(:,1),m(:,2)) 2 MAP2480, Fall 2008 Coordinator: Dr. Monica K. Hurdal ([email protected])
1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 0 10 20 30 40 50 60 b)Sorting Sort the women's Olympic records according to record time. (Should you use sort or sortrows?) sortrows(w) ans = 1.0e+003 * 1.9640 0.0520 1.9680 0.0520 1.9720 0.0511 1.9760 0.0493 1.9800 0.0489 1.9840 0.0488 1.9880 0.0486 Keeps the x and y columns associated with each other. c)Statistics Determine the minimum, maximum, mean, and standard deviation for the men's Olympic records. min(m) ans = 1.0e+003 * 1.8960 0.0439 max(m) ans = 1.0e+003 * 1.9880 0.0542 mean(m) ans = 1.0e+003 * 1.9415 0.0471 3 MAP2480, Fall 2008 Coordinator: Dr. Monica K. Hurdal ([email protected])

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
median(m) ans = 1.0e+003 * 1.9420 0.0464 var(m) ans = 905.1169 8.4624 std(m) ans = 30.0852 2.9090 Part 3: Polynomial Regression Please use MATLAB to obtain the equations for linear regression for both, the men's and the women's records. Display both lines in the same plot. menpr= xlsread('mensRecords.xls'); plot(m(:,1),m(:,2),'rx') xlabel('Year') ylabel('Records') title('Year versus Records') axis([1890 2000 40 60]) 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 40 42 44 46 48 50 52 54 56 58 60 Year Records Year versus Records wompr= load('womensRecords.txt'); plot(m(:,1),m(:,2),'rx') xlabel('Year') ylabel('Records') title('Year versus Records') axis([1890 2000 40 60]) 4 MAP2480, Fall 2008 Coordinator: Dr. Monica K. Hurdal ([email protected])
1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 40 42 44 46 48 50 52 54 56 58 60 Year Records

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

Lab10 comp - Name Ryan Corley Section 4 Problems for the...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online