Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

count.dat is a space-delimited text file. The file consists of three sets of hourly traffic counts, recorded at three different intersections over a 24-hour period,

image text in transcribedimage text in transcribed

count.dat is a space-delimited text file. The file consists of three sets of hourly traffic counts, recorded at three different intersections over a 24-hour period, all from the same town. Each data column in the file represents data for one intersection To load this file, place it in the same folder your.m script is, and use the line: load count.dat You can now access the values from count.dat using the variable count. You can create a graph using the following code: plot (1: 24, count), legend (' Intersection 1' , ' Intersection 2', 'Intersection 3') xlabel('Time'), ylabel (' Vehicle Count ') title (' Traffic Counts at Three Intersections Your task is to perform the following operations in your MatLab file 1 Load in count.dat and display it as a graph using the code above. 2. Find and display the maximum, minimum and average values from each traffic intersection (each intersection is one column) in a nice way. Be creative and do some google searches! There are many ways to accomplish this task. Hint: you can use the a-string- sprintf( , some value: %d some_variable) to format a string nicely, then display it with disp (a_string) 3. Take a look at the graph and data you've generated. Can you come to any conclusions regarding how count.dat was formatted, or any characteristics/features of these 3 intersections? Create a.txt or rtf or pdf file containing your thoughts. Be careful with naming variables! If you name a variable max. when you call the max?function you will get an error, because the function name has been overwritten by the variable name. Your .m file will need to output a graph, the maximum, minimum and average values from each intersection nicely. An example of output may be: Intersection 1, Min: 0.000000 Max: 21.000000 Avg: 9.166667 Intersection 2, Min: 10.000000 Max: 40.000000 Avg: 20.791667 Intersection 3, Min: 0.000000 Max 12.000000 Avg: 4.875000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions