If you have the Statistics toolbox, you can use nanmean(A,2) and nanstd(A,2).
If you don't have the toolbox, you can still avoid looping by doing
rowmeans = sum(B,2)./N;
rowstds = sqrt( sum(B.^2,2)./N -rowmeans.^2 );
If A is of type sparse, however, the above may need to be modified for efficiency's sake.