%Following are the marks for the final exam, assignments and midterm. %The arithmetic can be done using the matlab commands at the bottom. % You can copy and run this file with matlab to see the final mark in %the course. This also appears in the file finalgrade - in the same order %as these marks. The marks are also posted on my office door. % All the best for the holidays. Good job on the final exam! %Finalexam Assgn1 Assgn2 Midterm Assgn3 Assgn4 Assgn5 maxmark=[100 100 100 100 85 100 95]; wts=[10 25 65]; % assign, midterm, final a=[ 43 28 15 28 00 00 20 %93060358 00 00 00 00 00 00 00%93120625 65 79 60 65 46 00 29 %91156089 78 92 69 67 60 96 73 %90148257 90 84 74 68 00 87 61 %92422933 82 76 97 56 46 57 92 %92039005 86 79 72 51 33 53 53 %93007489 00 00 00 00 00 00 00 %92035350 00 00 00 00 00 00 00 %93008122 59 49 45 32 62 49 00 %94249481 86 65 56 50 64 82 45 %93055299 89 87 80 68 44 66 58 %93108115 72 59 00 68 56 43 44 %93007524 81 90 99 77 62 00 00 %92090297 88 89 98 53 68 46 70 %92012088 84 87 93 74 53 84 83 %92088343 98 91 70 78 81 93 87 %92159006 89 79 85 74 73 00 36 %90438703 00 00 00 00 00 00 00 %90089284 63 54 00 56 26 28 53 %92030127 66 57 00 65 83 63 69 %93119504 00 00 00 00 00 00 00 %92163386 99 91 85 90 85 92 87 %93033240 00 00 00 00 00 00 00 %93106102 52 72 65 48 31 41 45 %92117805 00 00 00 00 00 00 00 %91269020 93 81 87 64 74 82 85 %91106191 66 71 75 52 63 88 66 %92064698 81 68 98 53 20 86 70 %92087376 78 68 39 52 00 00 00 %92137053 60 37 20 41 59 38 61 %93010705 39 81 58 19 00 00 00 %89110423 90 85 80 67 71 55 55 %93521364 76 64 70 42 64 60 59 %92012024 55 63 50 43 46 76 00 %93044951 99 98 100 80 71 96 88 %93128032 67 56 00 51 00 50 35 %93078375 97 81 90 79 73 96 80 %93039548 94 82 90 71 69 90 75 %92300635 83 90 71 58 66 59 76 %94145891 00 00 00 00 00 00 00 %93126892 15 20 43 27 00 00 00 %93058844 75 85 95 46 56 86 95 %92100217 00 00 00 00 00 00 00 %93048407 00 47 43 44 49 00 00 %95001739 95 73 80 66 73 84 67 %92036828 82 91 99 82 59 86 78 %93345466 00 00 00 00 59 00 00 %93025458 87 59 52 66 82 50 53 %94355815 76 42 82 51 67 68 95 %91074077 65 72 37 73 00 44 00 %92024001 74 93 44 58 43 22 00 %92003458 78 51 57 57 64 26 50 %93034415 76 53 62 59 68 73 92 %91008360 76 44 68 67 59 54 67 %92301970 76 68 74 53 66 57 44 %92124411 51 90 50 70 00 00 00 %92336257 84 67 43 48 56 92 60 %90038565 77 60 00 71 51 00 50 %92059832 00 00 00 00 00 00 00 %91397508 81 73 90 58 65 96 78 %95990331 89 00 45 41 00 00 86 %92105912 54 00 00 25 00 00 00 %92073900 00 00 00 00 00 00 00 %92025145 69 97 56 89 60 75 78 %94148531 70 65 36 39 00 00 48 %91115243 ]; %calculate averages t=size(a,2); aves=zeros(1,t); nonzeros=zeros(1,t); for i=1 nonzeros(i)=sum(a( aves(i)=sum(a( % figure % hist(a( end %'number of nonzeros are' %nonzeros %'averages are' %aves vass=wts(1)/6; % value per each assignment vfinal=wts(3); vmid=wts(2); for i=1 finalg(i)=a(i,1)*vfinal/maxmark(1)+a(i,2)*vass/maxmark(2)+a(i,3)*vass/maxmark(3)+a(i,5)*vass/maxmark(5)+a(i,6)*vass/maxmark(6)+a(i,7)*vass/maxmark(7)+a(i,4)*vmid/maxmark(4); end nonzeros=sum(finalg>0); % number of nonzeros avesf=sum(finalg)/nonzeros; % average