User-Defined Function A function is a piece of computer code that accepts ar input argument from the user and provides output to th ne program You may wish to define your own functions-those which are used commonly in your programming User-defined functions are stored as m-files and can be accessed by Matlab if they are in the current directoryUser-Defined Function • A function is a piece of computer code that accepts an input argument from the user and provides output to the program. You may wish to define your own functions-those which are used commonly in your programming. User-defined functions are stored as M-files and can be accessed by Matlab if they are in the current directory. 9