A load (thermo scores.dat (a) Extract the scores and student number for student
ID: 666413 • Letter: A
Question
A load (thermo scores.dat (a) Extract the scores and student number for student 5 into a row vector named student 5. (b) Extract the scores for Test 1 into a column vector named test 1 (c) Find the standard deviation and variance for each test. (d) Assuming that each test was worth 100 points, find each student's final total score and final percentage. (Be careful not to add in the student number.) (e) Create a table that includes the final percentages and the scores from the original table. Student No. Test 1 Test 2 Test 3 61 91 70 10 85 71 85 12 13 15 75 91 () Sort the matrix on the basis of the final percentage. from high to low (in descending order). keeping the data in cach row together.You may need to consult the help function to determine the proper syntax.)Explanation / Answer
%data loading into vectors
rowVector = [1,68,45,92,0,0;2,83,54,93,0,0;3,61,67,91,0,0;4,70,66,92,0,0;5,75,68,96,0,0;6,82,67,90,0,0;7,57,65,89,0,0;8,5,69,89,0,0;9,76,62,97,0,0;10,85,52,94,0,0];
columnvector = [68,83,63,70,75,82,57,5,76,85;45,54,67,66,68,67,65,69,62,52;92,93,91,92,96,90,89,89,97,94];
sum = 0
for index = 1:numel(rowVector) %calcualting each student average and percentage
if(index <=4)
sum = sum + rowVector(index)
end
if(index == 4)
rowVector(4) = sum
rowVector(5) = sum/3
sum = 0
end
end
testSum=sum(columnvector,10) %calculating sum of each test
S = std(columnvector) %standard deviation
V = var(columnvector) %variance calculated for each test
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.