The code below is within a file called star.m:
function star
% star
disp('star');
function moon
% moon
disp('moon');
What happens if you run the moon function in the MATLAB command window (assuming current directory is set correctly) (i.e. >> moon)?