"Ben Lange" <firstname.lastname@example.org> wrote in message news:email@example.com... > I experienced this issue in the following scenario. > > Initially I named my .m file HW1.m, it worked fine. > I then renamed my .m file to be HW1-NearestNeighboar.m. > > I experienced the dreaded Undefined function or variable error. > > I then changed the - to _ and everything worked fine. > > Apparenly, MatLab doesn't support - characters in the *.m filename.