*****MATLAB QUESTION************ Let the vector G = [68, 83, 61, 70, 75, 82, 57,
ID: 3829849 • Letter: #
Question
*****MATLAB QUESTION************
Let the vector G = [68, 83, 61, 70, 75, 82, 57, 5, 76, 85, 62, 71, 96, 78, 76, 68, 72, 75, 83, 93] represent the distribution of final grades in an engineering course. The histc function can be used to determine the number of A’s, B’s, C’s, D’s and E’s in the grade data if the following grading scheme applies:
A > 90 to 100
B > 80 to 90
C> 70 to 80
D> 60 to 70
E> 0 to 60
WRITE A MATLAB PROGRAM TO USE THE BAR FUNCTION TO CREATE A HISTOGRAM BASED ON THIS SCHEME.
Explanation / Answer
Ans:::
program::-
% Using bar_func for creating hist.
% vector G = [68., 83., 61., 70., 75., 82., 57., 5., 76., 85., 62., 71., 96, 78, 76, 68, 72, 75, 83, 93]
G = [68, 83, 61, 70, 75, 82, 57, 5, 76, 85, 62, 71, 96, 78, 76, 68, 72, 75, 83, 93];
% finl_test_scores
% finl_scores from ascending
newG = sort(G(:));
%A find
A = find((newG < 100) & (newG > 90));
% bar(A)
bar(A)
% B find
B = find((newG < 90) & (newG > 80));
%bar(B)
bar(B)
%C find
C = find((newG < 80) & (newG > 70));
% bar(C)
bar(C)
%D find
D = find((newG < 70) & (newG > 60));
%bar(D)
bar(D)
%F find
F = find((newG < 60) & (newG > 50));
%bar(F)
bar(F)
// thankyou //
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.