function M = stdvsmean(A) %STDVSMEAN takes a 3D array of image data and computes %stdev vs. mean for each pixel %find means/st devs between each image astd = std(double(A),0,3); armn = mean(double(A),3); %convert into column vectors of pixel-by-pixel data asvec=ar2vec(astd); amvec=ar2vec(armn); M = [amvec asvec]; %plot data on same screen subplot(2,2,1:2) scatter(amvec,asvec) set(gca,'yscale','log') set(gca,'xscale','log') subplot(2,2,3) hist(amvec,512) set(gca,'yscale','log') subplot(2,2,4) hist(asvec,15) set(gca,'yscale','log') %title plots subplot(2,2,1:2) title('Pixel StDev vs. Mean') xlabel('Mean Pixel Intensity (arb. units)') ylabel('Pixel Intensity St. Dev (arb. units)') subplot(2,2,3) title('Mean Pixel Intensity') xlabel('Mean Pixel Intensity (arb. units)') ylabel('Number of Pixels in Bin (pixels)') subplot(2,2,4) title('Pixel Standard Devs') xlabel('Standard Dev. of Pixel Intensity (arb. units)') ylabel('Number of Pixels in Bin (pixels)') end