Question #200764

write a matlab program that grade up the data values according to grading criteria given below. then make the following graphs to show the number of students that got each grade 1. horizontal bar 2. pie 3. histogram


Expert's answer





1.) Horizontal Bar

Matlab code:

clear all
y = [5,15,20,5,3,2];
ax = gca;
barh(y,0.5,'b')
xlabel('Number of student');
ylabel('Grade');
title('Class Report');
ax.YTickLabel = ({'A','B','C','D','E','F'}); 

Output:  





2.) Pie

Matlab code:

clear all
y = [5,15,20,5,3,2];
labels = {'A','B','C','D','E','F'};
pie(y,labels)
title('Class Report');

Output:





3.) Histogram

Matlab code:

clear all
y = [5,15,20,5,3,2];
ax = gca;
bar(y,0.5,'b')
xlabel('Grade');
ylabel('Number of student');
title('Class Report');
ax.XTickLabel = ({'A','B','C','D','E','F'}); 

Output:







Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS