Code covered by the BSD License  

Highlights from
ProcessNetwork Version 1.0 Software

image thumbnail

ProcessNetwork Version 1.0 Software

by

 

Functions for the delineation of Dynamical Process Networks using Information Theory

[meanval,stdval]=GetStdThreeDims(matrix,NoDataVal)
function [meanval,stdval]=GetStdThreeDims(matrix,NoDataVal)

[dim1size,dim2size,dim3size]=size(matrix);

%count number of and total value of numbers in matrix
counter=0;
summer=0;
for i=1:dim1size
    for j=1:dim2size
        for k=1:dim3size
            if matrix(i,j,k) ~= NoDataVal         %not no data value
                if isfinite(matrix(i,j,k))    %not NaN
                    summer=summer+matrix(i,j,k);
                    counter=counter+1;
                end
            end        
        end
    end
end
meanval=summer/counter;


%add up the differences between matrix and mean, count number of values
counter=0;
summer=0;
for i=1:dim1size
    for j=1:dim2size
        for k=1:dim3size
            if matrix(i,j,k) ~= NoDataVal         %not no data value
                if isfinite(matrix(i,j,k))    %not NaN
                    summer=summer+abs(matrix(i,j,k)-meanval);
                    counter=counter+1;
                end
            end     
        end
    end
end
stdval=summer/counter;

Contact us