Where do we need to store a function to call it in other programs matlab code example Example: how to write a function in matlab function f = fact(n) f = prod(1:n); end