function above=fun2(x,avg) % Debugging example from Palm, "Introduction to Matlab 6 for Engineers" % Chapter 4. Comments by S. Scott Moor, April 2005 % This function is called by fun1. It determines how many values in an % input vector(x) are greater than the average of that vector (avg.) above=length(find(x>avg));