Watch this Author's files
Using bsxfun you could get this function more efficient, e.g.
A = a - bsxfun(@plus,mean(a),mean(a,2))+mean(a(:));
The code is only for independent correlation coefficients, if I get it right. You can also replace the functions fisherz and ifisherz with atanh and tanh, respectively.
The code mostly assumes a positive slope (e.g. the automatic selection of starting values).