Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Matlab GUI in order to achive following requirements Get 1 0 number of students grade from the user for three different lessons ( Math
Use Matlab GUI in order to achive following requirements
Get number of students grade from the user for three different lessons Math Phsc Music Attach these grades to a matrice.
Find and Show average grade of each lesson
Find and Show max and min grade for each lesson
Find and Show Standard Deviation of Each Lesson
Find and Show the students id and grade whose grade is greater than average grade of each lesson.
Find and Show the number of students whose grade is greater than average grade of each lesson.
Plot the chart for the average grade of each lesson
Plot the chart for the standard deviation of each lesson
Plot the chart for the number of students whose grade is greater than the average
Plot the chart for the max and min grades for each lesson
Plot the grade values for the Math, Phys and Music lessons for each student and Show all these graphics in one figure.
Plot the grade values of the students for the Math, Phys and Music lessons and Show all these graphics in one figure. there will be ten number graphics
I have tried to modify the code but I still can not meet the requirements help please
function gradeAnalyzerGUI
screenSize get 'ScreenSize';
figWidth ;
figHeight ;
fig figureName 'Grade Analyzer',
'Position', screenSizefigWidthscreenSizefigHeight figWidth, figHeight
'NumberTitle', 'off',
'MenuBar', 'none',
'ToolBar', 'none';
controlHeight ;
yOffset figHeight controlHeight ;
yOffset figHeight ;
textWidth ;
editWidth ;
spacing ;
uicontrolStyle 'text', 'String', 'Math Grades: 'Position', spacing yOffset, textWidth, controlHeight;
mathEdit uicontrolStyle 'edit', 'Position', spacing textWidth, yOffset, editWidth, controlHeight;
uicontrolStyle 'text', 'String', 'Physics Grades: 'Position', spacing textWidth editWidth, yOffset, textWidth, controlHeight;
physEdit uicontrolStyle 'edit', 'Position', spacing textWidth editWidth, yOffset, editWidth, controlHeight;
uicontrolStyle 'text', 'String', 'Music Grades: 'Position', spacing textWidth editWidth yOffset, textWidth, controlHeight;
musicEdit uicontrolStyle 'edit', 'Position', spacing textWidth editWidth yOffset, editWidth, controlHeight;
calculateButton uicontrolStyle 'pushbutton', 'String', 'Calculate',
'Position', spacing textWidth editWidth yOffset, controlHeight
'Callback', @calculateButtonCallback;
ax zeros;
for i :
row ceili ;
col i row ;
axi subplotrow col;
pos getaxi 'Position';
setaxi 'Position', pos pos pos pos;
end
function calculateButtonCallback~ ~
mathGrades strnumgetmathEdit 'String';
physGrades strnumgetphysEdit 'String';
musicGrades strnumgetmusicEdit 'String';
if lengthmathGrades ~ lengthphysGrades ~ lengthmusicGrades ~
errordlgPlease enter grades for each subject. 'Input Error';
return;
end
gradesMatrix mathGrades; physGrades; musicGrades;
avgGrades meangradesMatrix;
maxGrades maxgradesMatrix;
minGrades mingradesMatrix;
stdDeviations stdgradesMatrix;
studentsAboveAvg sumgradesMatrix meangradesMatrix;
for i :
axesaxi;
cla reset;
end
titles Average Grades', 'Max Grades', 'Min Grades', 'Standard Deviations', 'Students Above Avg', 'Math Grades', 'Physics Grades', 'Music Grades';
subjects Math 'Physics', 'Music';
data avgGrades maxGrades, minGrades, stdDeviations, studentsAboveAvg, gradesMatrix : gradesMatrix : gradesMatrix :;
for i :
axesaxi;
bardatai;
setaxi 'XTickLabel', subjects, 'XTick', :lengthsubjects;
titletitlesi;
end
studentIDs :;
for i :
axesaxi;
plotstudentIDs dataio;
xlim;
ylim;
setaxi 'XTick', studentIDs;
xlabelStudent ID;
ylabelGrade;
titlesubjectsi Grades';
legendsubjectsi;
end
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started