Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created June 15, 2021 13:13
Show Gist options
  • Save ntakouris/49a724cec790878578349da768f67f94 to your computer and use it in GitHub Desktop.
Save ntakouris/49a724cec790878578349da768f67f94 to your computer and use it in GitHub Desktop.
function [mean_per_class, num_fail_students] = courses_calc(data_vec)
mean_per_class = mean(data_vec(:).grades, 1);
failed_students = data_vec(:).grades > 5;
num_fail_students = sum(failed_students, 1);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment