Home > analysis > distribution.m

distribution

PURPOSE ^

strip_zeros_and_nan value out of the input matrix

SYNOPSIS ^

function newMatrix = distribution(matrix)

DESCRIPTION ^

strip_zeros_and_nan value out of the input matrix

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function newMatrix = distribution(matrix)
0003 %strip_zeros_and_nan value out of the input matrix
0004 
0005 newMatrix = zeros(0,2);
0006 for i = 1: size(matrix,1)
0007     tempTrackArray = [];
0008     for j = 1: size(matrix,2)
0009         if (matrix(i,j) ~= 0 )&& ~isnan(matrix(i,j))
0010             tempTrackArray = [tempTrackArray matrix(i,j)];
0011         end
0012     end
0013     if ~isempty(tempTrackArray)
0014         newMatrix(end+1,:) = [mean(tempTrackArray(:)) std(tempTrackArray(:))];
0015     end
0016 end
0017 end

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005