The standard deviation of a single value is always 0.
You need be applying mean() and std() to the same vector of values. "vector" is a key term here.
Hint:
pixelvector = squeeze(Image_Matrix_3D(i,j,:));
mean(pixelvector)
std(pixelvector)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!