Write a script (use nested ifs or if-else and for loops in your script.) that re
ID: 1827930 • Letter: W
Question
Write a script (use nested ifs or if-else and for loops in your script.) that reads following numbers using matlab
60
85
60
83
17
30
20
38
10
38
85
65
25
100
91
95
55
95
20
93
-calculate the mean and standard deviation for the entire class
-loop all over the vector of grades and, for each student, display to the user the performance
of the student with one of the following sentences regarding student performance as
indicated:
"The student X performed poorly with a grade of XX.X!" if the student grade is 1 standard
deviations below the class mean or
"The student X performed really good with a grade of XX.X!" if the grade of this student is
greater than 91.00 or
"The student X performed satisfactorily with a grade of XX.X!" if the grade of this student is
greater than 75.0 or 1 standard deviations above the class mean.
"I don%u2019t know about the performance of student X!" otherwise.
Explanation / Answer
% Use the trapezoid rule to approximate the integral from 0 to 1 % of exp(x), using N (=25) intervals % Your name and the date N=25; h=1/(N-1); x=-h; % look at this trick approxIntegral=0.; for k=1:N % compute current x value x=x+h; % add the terms up if k==1 | k==N approxIntegral=approxIntegral+(h/2)*exp(x); % ends of interval else approxIntegral=approxIntegral+h*exp(x); % middle of interval end end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.