I wanted to know how I can go about passing an optional/default parameter to a user-defined function. If I try to do it the C++ way it gives me a syntax error (sample code below). This is possible in some of the in-built functions like Plot(). Similarly, is it possible to have default parameters in user-defined functions?
function UserDefinedFunctionWithOptionalParameters(optionalParam = 0) {
printf("optionalParam = %g", optionalParam);
}
// Gives a syntax error.
UserDefinedFunctionWithOptionalParameters() // Should print 'optionalParam = 0'