Matlab Grade book help --drop one lowest score and assigning letter grade
显示 更早的评论
Hi I am building a gradebook that allows me to drop the lowest assignment score and only takes 10 assignment scores and adds all the test scores. I need to assign a letter grade to each student.
Here is some data

I am stuck on dropping the lowest score and assigning students to a grade in my function. if there is a better way of doing it without a function... please tell me...
function [sumarr] = grades(structure, field)
% FUNCTION GRADES accepts any cell array value and assigns a letter
% all data entered must be transposed from rows to colums please remember
% to transpose data example transposedata = data' ---> data = [FILE that
% was imported]
%DEFINE VARIABLES
% ii -- index variable
ii =0 ;
array =[];
for ii = 1:length(structure)
%build an array
array = [array structure(ii).(field)];
end
% if one grade is less than 2, drop the score.
% assign Letter grades
%sum of all grades
sumarr = sum(array);
end
3 个评论
R Bruggink
2014-11-29
How do you store your grades. like a struct: persons.torry.grade1.1 or a cell array. It makes a different when sorting the arrays.
Iris
2014-11-29
khalid
2014-12-6
How are you doing on the new assignment?
采纳的回答
更多回答(1 个)
khalid
2014-12-1
0 个投票
Do you happen to be taking this class at SMC?
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!