Question: Anyone can help me to finish this code the code below and questions below close all clear all clc fileList = dir('C:OneDrive_UMassUMassOneDrive - University of
Anyone can help me to finish this code the code below and questions below
close all
clear all
clc
fileList = dir('C:\OneDrive_UMass\UMass\OneDrive - University of Massachusetts - Amherst\2-Teaching\CEE418-518\New Material\3-Homework\3.1-HW1\3.1.2-HW1_Student\HW1_data1\*.v30');
count = length(fileList);
data_v = nan(2880,count);
for i = 1:count
fid = fopen([fileList(i).folder '\' fileList(i).name]);
data_v(:,i) = fread(fid,'int8');
fclose(fid);
i
end
fileList = dir('C:\OneDrive_UMass\UMass\OneDrive - University of Massachusetts - Amherst\2-Teaching\CEE418-518\New Material\3-Homework\3.1-HW1\3.1.2-HW1_Student\HW1_data1\*.c30');
count = length(fileList);
data_c = nan(2880,count);
for i = 1:count
fid = fopen([fileList(i).folder '\' fileList(i).name]);
data_c(:,i) = fread(fid,'int16');
fclose(fid);
i
end
csvwrite('data_v.csv',data_v)
csvwrite('data_c.csv',data_c)
% data_c.*data_v
% doc csvwrite
Data collected from a loop detector station for 24 hours are included in the attached file HW1_data1.traffic. Please answer the following questions.
The data was provided by Minnesota Department of Transportation and was coded using binary unified transportation sensor data format (UTSDF). The format of UTSDF is explained in the attached file HW1_UTSDF.pdf. Reformat the files in the Excel format as shown in Figure 1 (Hint 1: In MATLAB, use dir command to merge the files based on their sequence for flow and occupancy; Hint 2: In MATLAB, use fread commend to open and read the binary file by designated bytes).
a. Error checking: check the detector data provided;
b. Calculatethespeedfromtheflowandoccupancydata.Stateyourassumptions
clearly;
c. Analyze the data to determine changes in traffic states if any and their
characteristics;
d. The detector is located approximately in the middle of a 1-mile freeway
segment. Calculate the delay to the traffic stream (Hint: define delay first and then calculate the delay in veh-hrs).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
