Created
June 15, 2021 13:09
-
-
Save ntakouris/b189ed6ea800ef96f5ec3b87b1eb4815 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function students_calc(data_vec) | |
mean_grades = mean(data_vec(:).grades, 1); | |
file_data = [data_vec(:).name, data_vec(:).surname, mean_grades]; | |
file = fopen('student_mean.txt','w'); | |
fprintf(file,'%s %s %f\n', file_data); | |
fclose(fileID); | |
[argvalue, argmax] = max(mean_grades); | |
best_student_name = data_vec(argmax).name; | |
best_student_surname = data_vec(argmax).surname; | |
print_data = [argvalue, best_student_name, best_student_surname]; | |
fprintf('Mathitis me ton megalytero meso oro(%f): %s %s', print_data); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment