MATLAB: How to print a certain amount of elements in an array

arrayMATLABmatrixmatrix arraymatrix manipulation

If I have an array of student ID in column1 and GPAs in column2
EX:
Info = [52211 3.55; 52922 1.79; 51939 3.33; 12140 0.81]
How can I print the first 2 elements in the array based on the GPA??

Best Answer

An example:
id = Info(:,2) > 3
students_gpas = Info(id,:) %students whose GPA is more than 3