Required array is dependent on other arrays
Mostrar comentarios más antiguos
The overall scores out of 100 students is included in the ascii file Scores.txt. The cut-off ratios for the letter grades are
Percentage, % Final Grade Letter
90 < Grade = A
80 < Grade < 90 = B
70 <= Grade < 80 = C
60 < Grade < 70 = D
Grade < 60 = F
Write a computer program in a script file that
a.Import the data in the text file Scores.txt using the load () command/function and assign it to a variable name Scores.
b.Assign the 1st column of Scores variable to ID and the second column to OG.
c.Determines the average score (S_avg) in the class. You can use the MATLAB built-in functions mean ().
d.Determines the number of students above the average (N_aavg). You can use the MATLAB built-in functions sum (). Please see the help of the functions sum() and mean () before using them.
e.Determine the number of students within +5% of the average (N_5avq).
f.Determines the number of students in each letter grade (N_A, N_B, N_C, N_D, N_F).
g.Determines the ID of students in each letter grade (ID_A, ID_B, IDC, ID_D, ID_F).
%<MY CODE WAS HERE>
HELP with:
The code below is what I have written so far, and have attached the txt file required.
I need help with part g, where it needs to create an array with the IDs of the students of that certain threshold.
when I run the code, it returns a single value rather than an array of required IDs.
Also, is there a better way to do parts d and e using sum() and mean() functions?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!