Q:

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

0

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. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

total answers (1)

Similar questions


need a help?


find thousands of online teachers now