Question

Write a code that gets the quiz grades of a class. A matrix with n rows...

Write a code that gets the quiz grades of a class. A matrix with n rows and m columns where n stands for number of students and m is the number of quizzes. Let’s call the matrix A. Then, your code drops the lowest grade of each student and remove it from the matrix. Also, it finds the average grade for the quizzes for each student and add a new column to the end the matrix. in matlab please

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:-

%MATLAB CODE:-

clear

n=input('enter no of students\n');

m=input('number of quiz');

for i=1:n

fprintf('enter grades of student %i\n',i);

for j=1:m

fprintf('quiz %i\n',j)

A(i,j)=input('enter grades');

end

end

fprintf('input matrix\n');

A

for i=1:n

B=A(i,:);

[~,a]=min(B);

B(a)=[];

C(i,:)=B;

end

fprintf('removed low grades\n')

A=reshape(C,n,m-1);

A

fprintf('final grade matrix after adding avg grades\n')

for i=1:n

A(i,m)=sum(A(i,:))/(m-1);

end

A

%end of MATLAB CODE

%OUTPUT:-

.

Add a comment
Know the answer?
Add Answer to:
Write a code that gets the quiz grades of a class. A matrix with n rows...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT