The loop could look something like this:
n = numel(a);
got5or6 = 0;
if( _______ )
got5or6 = got5or6 + 1;
You need to write code for the two places indicated above. For the if-test, the code would test to see if a(k) is equal to 5 or equal to 6. For the display part, you will write code to see which range the got5or6 value fits into and then print the appropriate message. Give this a try and then ask for more help if you need it.