Tags recommended by the template: article:topic
By Carey A. Smith
Functions can have outputs, even though they have no input arguments.
These are some built-in Matlab functions with no inputs:
date % Try it
datetime % Try it
The function definition of such a file would be like this:
function [date1] = date()
An interesting Matlab function with no inputs is:
This is used as a constant, but it is an actual function. You could define your own functions for constants such as Avogadro’s number, the universal gravitational constant, the speed of light, or a parsec’s distance.