MATLAB: If there is any way to call a function of the same name but less arguments.

function

e.g we have a function demo( arg1, arg2) { . . }end
now calling the same function with more arguments demo(arg1,arg2,arg3)
I know it will generate error. But I want to know if there is any other way to do this.

Best Answer

If the function already exists, and you cannot modify it, then no. As you said yourself, it will generate an error. You cannot pack 3 pounds of "stuff" into a 2 pound bag. The same applies to arguments of functions.
Note that the reverse will sometimes work, you can (sometimes) call a function that requires 3 arguments, passing in only the first two of them, IF the function is coded to handle that eventuality.
Related Question