excel and matlab problem
Ältere Kommentare anzeigen
I have this set of data and i want to grade the average grades and output each students result with the grade. Currently the code still does not assign the grades with the averages. Kindly assist
T = readtable('C:\Users\RONNIE\Documents\EXCEL.xlsx');
NAMES = T.(1) ;
format short
AvgMarks = mean(table2array(T(:,2:end)),2) ;
if (70<=AvgMarks)&(AvgMarks<=100)
fprintf ('A')
elseif (60<=AvgMarks)&(AvgMarks<=69)
fprintf ('B')
elseif (50<=AvgMarks)&(AvgMarks<=59)
fprintf ('C')
elseif (40<=AvgMarks)&(AvgMarks<=49)
fprintf ('D')
else
fprintf ('E')
end
Tavg = table(NAMES,AvgMarks)
STUDENTRESULTS=T(1,1:end)
format short
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!