function y=fun1(x) % Debugging example from Palm, "Introduction to Matlab 6 for Engineers" % Chapter 4. Comments by S. Scott Moor, April 2005 % This function is intended to look at vector of numbers (x) and return (y) the % number of values that are greater than the average of the vector. It % calculates an average (avg) then uses fun2 to count the values greater than the % average. % avg=sum(x)/length(x); y=fun2(avg,x);