You can run fminunc in a loop with a single iteration in each pass (by setting MaxIter=1). Within the loop, you can also apply your filter.
options=optimoptions('fminunc','SpecifyObjectiveGradient',true,...
'Display','iter','MaxIter',1);
best_x=x0;
for i=1:N
[best_x, fval, exitflag, output] = fminunc(func,best_x,options)
best_x=myFilter(best_x);
end