MATLAB Language Functions Base example


Example

The following MATLAB script shows how to define and call a basic function:

myFun.m:

    function [out1] = myFun(arg0, arg1)
        out1 = arg0 + arg1;
    end

terminal:

    >> res = myFun(10, 20)

    res =

        30