rng('default')
data(:,1) = randperm(300);
data(:,2) = randi(4,300,1) + 14;
data(:,3) = randi(20,300,1)/10 + 2;
checkvalues = mean(data);
gpa4 = [];
class_honors = [];
class_psych = 0;
ctr = 1;
for i = 1:300
if data(i,3) == 4.0
gpa4 = gpa4 + data(i,1);
end
if (data(i,2) == 2015) & (data(i,3) >= 3.5)
class_honors = class_honors + data(i,1);
end
if (data(i,2) == 2018) & (data(i,3) >= 3.0)
class_psych + 1;
end
end
disp('Students with a 4.0:')
disp(gpa4)
disp('Seniors with honors:')
disp(class_honors)
disp('# of first year potential psychology majors:')
disp(class_psych)
student_one = data(1,3);
disp('Student One GPA:')
disp(student_one)
class_17 = std(data(:,2));
disp('Class of 17 GPA Standard Deviation:')
disp(class_17)