Defining function handles in MATLAB
www.mathworks.com › matlabcentral › answersJan 08, 2012 · To define a function in matlab you can do following syntax of given function: function n = F (x) n= 2*x^3+7*x^2+x; that is it. You can put end at the end of function. But it is also acceptable not to put to various matlab versions. If you put end for one function then you have to put for all function in single m file.