Suggestion #1
% At the beginning of your script:
rmpath('C:\the\folder\containing\the\custom\zeros');
builtInZeros = @zeros;
addpath('C:\the\folder\containing\the\custom\zeros');
% Calling the custom zeros later:
a = zeros(10, 20);
% Calling the built-in zeros:
b = builtInZeros(10, 20);
Suggestion #2
Put these three lines into your startup file:
rmpath('C:\the\folder\containing\the\custom\zeros');
builtInZeros = @zeros;
addpath('C:\the\folder\containing\the\custom\zeros');
Suggestion #3
It's definitely a dangerous idea to reuse the name of a built-in function. It ruins the readability of your scripts, making them much more difficult to maintain. So if you have control over the custom zeros
function, then rename it to something else. Use a name which describes how the custom version is different from the built-in one (for example, call it fastZeros
if it's faster).