Cell array indexing question
Ältere Kommentare anzeigen
Hi All,
I'm trying to have it so that this will loop thorugh and put all the numbers/ characters in for the different places in the fprintf statement. I have it so it will run the name, but after that it won't run the right thing. Any help would be appreciated!
%% Part A
load('QuizGrades.mat')
student_Names={'Student1','Student2','Student3','Student4','Student5','Student6','Student7','Student8','Student9','Student10','Student11','Student12','Student13','Student14'};
student_IDs=[101:114];
grade_Book={student_Names,student_IDs,grades}
cellplot(grade_Book)
%% Part B
mean(grade_Book{3}(3,:))% mean of the quiz grades for student 3
mean(grade_Book{3}(:,5))% mean of student grades on quiz 5
mean(grade_Book{3}())% mean of grades for all quizzes
%% Part C
[M,I]=min(grade_Book{3},[],2)%minimum grade for each student in one vector and the index for the quiz in another
%% Part D
for x=[1:14]
fprintf('<%s>(%d)will drop grade(%s)from grade(%s)',(grade_Book{1}{:}),(grade_Book{2}(:)),(grade_Book{3}{:}),I)
end
I'm trying to have it to say <student name> (student ID) will drop (grade) from quiz (indexed quiz number)
Thank you for your help in advance!
2 Kommentare
Stephen23
am 20 Feb. 2021
Please upload 'QuizGrades.mat' by clicking the paperclip button.
Brittany Isbister
am 21 Feb. 2021
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices 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!