Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Is there a shortcut way of making optional parameters in a function in either M15 or Prime 3.0? I haven't come across anything regarding this issue yet.
I ask as this would be a great way to implement the same function with some options. We could use [] to define the optional parameter with the number inside defining the default value.
If you mean a user defined function that could be called with a variable number of parameters, that's not possible. It's another long standing request.
Sorry to resurrect an old post, but this is the first result on Google for the query "mathcad optional parameters" and I am hoping it will be helpful to someone.
One solution would be to pass an array/matrix as the only parameter to the function, then within the function use the try/on error statement to check if your optional parameter is defined or if you need to give it a default value. This could get very verbose very quickly if you have a lot of optional parameters, but should work in Mathcad 15 as well as Mathcad Prime Alpha3 or newer.
