Create a spreadsheet that has on each line an integer student identification number followed by three quiz grades for that student. Read that information from the spreadsheet into a matrix, and print the average quiz score for each student
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:1.9
All Answers
total answers (1)
Ch9Ex1.m
% Read student data from a spreadsheet and print
% quiz averages
mat = xlsread('quiz.xlsx'); %Read in data from a spreadsheet
[r, c] = size(mat);
for i = 1:r
quizave = sum(mat(i,2:end))/3; %Calculate quiz average
fprintf('Student #%d has a quiz average of %.1f\n',...
mat(i,1),quizave)
end
need an explanation for this answer? contact us directly to get an explanation for this answer