Script needed for lab using Matlab for pic. Here is data below: 1x1 struct with 2 fields Field Value Females

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Script needed for lab using Matlab for pic. Here is data below: 1x1 struct with 2 fields Field Value Females

Post by answerhappygod »

Script needed for lab using Matlab for pic. Here is databelow:
1x1 struct with 2 fields
Field Value
Females 300x1 Double
Males 300x1 Double
HeightData=Load ('ENGR131_20S_Lab06_HeightData.mat');
m=HeightData.Males;
f=HeightData.Females;
subplot(1,2,1)
plot('1:1 length(m),f,1:length(m),m');
legend('females','Males');
xlabel('Observation');
ylabel('Height(cm)');
subplot(1,2,1)
hold on;
hist(m);
hist(f);
legend('Female', Males');
xlabel('Height(cm)');
Script Needed For Lab Using Matlab For Pic Here Is Data Below 1x1 Struct With 2 Fields Field Value Females 1
Script Needed For Lab Using Matlab For Pic Here Is Data Below 1x1 Struct With 2 Fields Field Value Females 1 (101.29 KiB) Viewed 35 times
Script Needed For Lab Using Matlab For Pic Here Is Data Below 1x1 Struct With 2 Fields Field Value Females 2
Script Needed For Lab Using Matlab For Pic Here Is Data Below 1x1 Struct With 2 Fields Field Value Females 2 (140.63 KiB) Viewed 35 times
DWG MA 140 130 120 (a) 0 50 100 150 Observation 200 250 ENGR 131 ZZZ-90-030-06 (Lab 6 Instructions) 300 (b) 10 3/5/2020 5 0 120 130 140 150 2.COMPUTING AND DISPLAYING STATISTICS (15 PTS) Recreate Table 1 by performing the following: A. Compute the statistics on the data for each gender (5 pts). B. Create the table (5 pts) shown in Table 1. For the table, use the *VariableName' property of the table command to set the column labels. C. Perform a paired t-test on the two sets of heights and report back to the workspace the p-value as well as whether or not the two populations are statistically different (p<0.05) using an if-else to test the condition (5 pts). 3. SORTING (15 PTS) Sort the data using both a manually coded sort as well as Matlab's sorting. Time each method. Perform this by the following: A. Create a function to sort data using the selection sort algorithm discussed in class (8 pts). 160 170 Fig 1. Plot of heights of males and females (a) and the distribution of heights by gender (b). Height (cm) 180 190 Max 200 Mean 165.03 Min 210 220 Page 1 of 3 Females Males Std Dev 13.908 14.387 174.13 Median 165 174.4 211.6 216.4 129.4 129.1 Table 1. Statistics of recorded heights by gender. Heights are in cm.
3. SORTING (15 PTS) Sort the data using both a manually coded sort as well as Matlab's sorting. Time each method. Perform this by the following: A. Create a function to sort data using the selection sort algorithm discussed in class (8 pts). Sorted Heights B. Sort each data set and place the results in a nested data structure where each gender field is separated into manual and Matlab sorted values (Fig 2a, 2 pts). (a) C. Time each sort using the tic and toc commands. After both genders and both methods of sorting you should have a 2x2 matrix of times where each column is the time for one type of sort (2 pts). D. Plot the sorted data as shown in Fig 2b. If your sort function is working properly, the data sets should overlap each other for each gender's heights (2 pts). E. Report the average time for the manual and Matlab sorts to the workspace. Females Males Manual Matlab Manual Matlab 220 (b) 210 200 190 180 €170 160 150 140 120 Min Table 1. Statistics of recorded heights by gender. Heights are in cm. 100 Sorted Height by Gender and Sort Method 129.4 129.1 Observation 200 Females Auto Males Manual Males Auto 250 300 Fig 2.Diagram of sorted data structure (a) and plot of sorted heights by gender using manual and Matlab's built-in sort functions
2.COMPUTING AND DISPLAYING STATISTICS (15 PTS) Recreate Table 1 by performing the following: A. Compute the statistics on the data for each gender (5 pts). B. Create the table (5 pts) shown in Table 1. For the table, use the 'VariableName' property of the table command to set the column labels. C. Perform a paired t-test on the two sets of heights and report back to the workspace the p-value as well as whether or not the two populations are statistically different (p<=0.05) using an if-else to test the condition (5 pts). 3. SORTING (15 PTS) Sort the data using both a manually coded sort as well as Matlab's sorting. Time each method. Perform this by the following: A. Create a function to sort data using the selection sort algorithm discussed in class (8 pts). Sorted Heights (a) Females Males Manual Matlab Manual Matlab Height (cm) (b) 220 210 B. Sort each data set and place the results in a nested data structure where each gender field is separated into manual and Matlab sorted values (Fig 2a, 2 pts). C. Time each sort using the tic and toc commands. After both genders and both methods of sorting you should have a 2x2 matrix of times where each column is the time for one type of sort (2 pts). D. Plot the sorted data as shown in Fig 2b. If your sort function is working properly, the data sets should overlap each other for each gender's heights (2 pts). E. Report the average time for the manual and Matlab sorts to the workspace. 200 190 180 170 160 150 140 130 120 0 Mean 50 Std Dev L 100 Median Max Min Sorted Height by Gender and Sort Method 150 Observation Females Males 200 165.03 174.13 O 13.908 14.387 165 Table 1. Statistics of recorded heights by gender. Heights are in cm. 211.6 216.4 174.4 129.4 129.1 Females Manual Females Auto Males Manual Males Auto 4 250 300
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply