You cannot create non-anonymous functions in the command window. You need to compose them in a .m file. It is recommendable that you use the Matlab Editor for that,
>> edit myFunction.m
See also,
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!