This is matlab question : Problem1_data 2 : Problem1_data 1: 0.1 0.50 0.75 0.85
ID: 2079399 • Letter: T
Question
This is matlab question :
Problem1_data 2 :
Problem1_data 1:
0.1 0.50 0.75 0.85 500 800 10000 1300 0.01 .005 0.025 0.03 Background: Two lab technicians are testing the power and potential that results from various mass being propelled into the air by an air cannon. Each engineering recorded there results in the data file provided for this problem; however, the units were not consistent. In the first data collection session (Problem 1_data1.csv), a lab technician collected three different measurements and recorded mass in grams in row 1, height in feet in row 2, and time in minutes in row 3. However, in data collection session two (Problom1_data2.csv), a different lab technician collected four different measurements and recorded mass in pounds mass, height in centimeters, and time in hours. The goal of this program is to calculate the potential energy in joules and power in watts for each data session. The program should only consider variables in SI units, so you will need to convert the vector prior to calculating your results. You will create one final matrix that combines the two collection sessions and has the mass in grams in column 1, the potential energy in column 2, and the power in column 3. You will export this matrix to a .csv fill named Problem1_results.csv and will use the matrix to produce the formatted output below. In addition, to complete the sample output shown below, you will need to also determine: the number of total observations made in each session combined. the minimum mass recorded (in grams) and the associated potential energy and power for the combined data set. the average mass recorded (in grams) and the average potential energy and average power for the combined data set. Coding Requirements: Include required documentation and header for the problem. The output of your program should look like the sample output displayed below with the same spacing, indentations, and number of significant digits. The total number of combined observations record is 7. The minimum mass recorded was 10.0 [g]. It had a potential energy of 0.149 [J] and a power of 0.002 [W]. The average mass [g] record is: 161.8 The average potential energy [J] calculated is: 15.1 The average power [W] record is: 0.3
Explanation / Answer
data_1 = csvread('D: rivimproblem_1_data_1.csv',1,0)
Mass_1 = data_1(:,1)/1000 %convert gram in kilogram
Height_1 = data_1(:,2)*0.3048 %convert feet in meter
Time_1 = data_1(:,3)*60 %convert min in sec
data_2 = csvread('D: rivimproblem_1_data_2.csv',1,0)
Mass_2 = data_2(:,1)*0.45359237 %convert pound mass in kilogram
Height_2 = data_2(:,2)*0.01 %convert cm in meter
Time_2 = data_2(:,3)*60*60 %convert hour in sec
Mass = [Mass_1;Mass_2]
Height = [Height_1;Height_2]
Time = [Time_1;Time_2]
PE = Mass.*9.8.*Height
Power = PE./Time
required_table = [Mass*1000,PE,Power]
index_min_mass = find(required_table == min(required_table(:,1)))
disp(['Total number of combine observation record is' num2str(length(required_table))])
disp(['The Minimum mass recorder was ' num2str(required_table(3,1)) '[g]'])
disp(['It had potiential energy of ' num2str(required_table(3,2))...
'[j] and power of ' num2str(required_table(3,3)) ' [W]'])
disp(['The average mass [g] record is: ' num2str(mean(required_table(:,1)))])
disp(['The average potiential energy [j] calculated is: ' num2str(mean(required_table(:,2)))])
disp(['The average power [W] record is:' num2str(mean(required_table(:,3)))])
csvwrite('D: rivimProblem1_result.csv',required_table,1,0) % before writing result in file creat empty output file
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.