Both have got same extension as (.m). Script file type in matlab consists of series of commands. They do not take any arguments neither they return any arguments or any values. Function is like any other programming language function. It takes arguments as well as returns arguments.