{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Lab11 - Riti Gupta/20249537 Section22/Lab11 1 a X=[0:23...

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

Riti Gupta/20249537 Section22/Lab11 1. a.) X=[0:23]; Y=[809, 528, 499, 632, 1109, 3051, 4958, 4877, 4574, 4276, 4062, 4204, 4117, 4183, 4474, 4685, 4838, 4869, 4425, 3377, 2659, 2439, 1965, 1119]; X1=[0:(5/60):23]; Y11=interp1(X,Y,X1, 'nearest' ) Y12=interp1(X,Y,X1, 'linear' ) Y13=interp1(X,Y,X1, 'spline' ) plot(X,Y, 'go' ,X1,Y11,X1,Y12,X1,Y13) title( 'Interpolation of Traffic Data' ) legend( 'data' , 'nearest' , 'linear' , 'spline' ) xlabel( 'Time(in hours)' ) ylabel( 'Number of Vehicles' ) (did not include matrices because too much data) b.) X=[0:24]; Y=[809, 528, 499, 632, 1109, 3051, 4958, 4877, 4574, 4276, 4062, 4204, 4117, 4183, 4474, 4685, 4838, 4869, 4425, 3377, 2659, 2439, 1965, 1119, 809]; X1=[0:(5/60):28]; Y11=interp1(X,Y,X1, 'nearest' ) Y12=interp1(X,Y,X1, 'linear' ) Y13=interp1(X,Y,X1, 'spline' ) plot(X,Y, 'go' ,X1,Y11,X1,Y12,X1,Y13) title( 'Interpolation of Traffic Data' ) legend( 'data' , 'nearest' , 'linear' , 'spline' ) xlabel( 'Time(in hours)' ) ylabel( 'Number of Vehicles' ) (again, too much data output) 0 5 10 15 20 25 0 1000 2000 3000 4000 5000 6000 Interpolation of Traffic Data Time(in hours) Number of Vehicles data nearest linear spline

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

View Full Document
The extrapolated values do not look reasonable because according to the data given, the value of the extrapolation exceed the data by a great amount. You cannot have traffic counts that are less than zero and it is not physically meaningful because the lowest you can get is zero cars.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}