User-Defined Functions which return a Single Value:
We have seen the use of many functions in the MATLAB. We have used many built-in functions like fix, sin, abs, double, and so forth. In this part, the user-defined functions will be introduced. These are the functions which programmer defines, and uses, in either the Command Window or in a script.
The Functions can return various types of results. For now, we will concentrate on the type of function which computes and returns a single result, as like built-in functions like sin and abs.
At First, let us review some of what we know about functions, involving the use of built-in functions. Though the use of these functions is clear-cut by now, descriptions will be given in some detail here in order to compare and contrast the use of the user-defined functions.