I have a problem that I could solve by changing my function's name. But I want to know if there's an option to call a MATLAB-defined function which has the same name of my user-defined function. By default, MATLAB always uses the user-defined function, but I want to use both in the same script. Any idea?
MATLABfuzzytoolbox::addrule(); userDefined::addrule()
Matlab uses the first function with the specified name that shows up in the path, and there is no mechanism to call specifically one of the functions sharing the same name.
A good practice is to put your functions into packages. In this way you can name them with the same name than a built-in function, but the call is slightly different: for instance if you have a function addrule in the package Pack (i.e. a file addrule.m in a folder +Pack), you can call it with Pack.addrule, while the built-in addrule function is simply called by addrule.
Best,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With