- Functions in MATLAB start with the keyword 'function' followed by output arguments, a valid function name, and optional input arguments. For example, function p=prime_num(a,b).
- A function can return multiple values using square brackets around the output arguments. For example, function [o1,o2]=myfunction(a,b,c) returns two outputs.
- To call a function, type its name and pass any required arguments in the command window. Returned values can be stored in variables or displayed directly without semicolons.