I wonder if there is a way to set a default value in a function definition.
For example, I set up a function
f[x_, y_] := (x + y)*2
I would like to set the default value of y=5, therefore, even though I only give x equal to 1, the function will return 20.
f[x_, y_ : 5] := (x + y)*2– cvgmt Jul 23 '22 at 07:28