getclstrscores

PURPOSE ^

GETCLSTRSCORES gets the mean score of a cluster.

SYNOPSIS ^

function clstrscores=getclstrscores(clstrs,scores)

DESCRIPTION ^

 GETCLSTRSCORES gets the mean score of a cluster.

 GETCLSTRSCORES gets the mean score of a cluster given the scores of the
 individual points.
 
 INPUTS:
     clstrs: MxN array. clstrs should be the same size as rangeMatrix.
     Each element in clstrs is an integer indicating the line cluster the
     range to which reading belongs.
 
     scores: MxN array with the score of each element.
 
 OUTPUTS:
     clstrscores: MxK array where K is the largest cluster number. It
     contains the mean scores for each cluster.
 
 Abdallah Kassir 1/3/2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function clstrscores=getclstrscores(clstrs,scores)
0002 % GETCLSTRSCORES gets the mean score of a cluster.
0003 %
0004 % GETCLSTRSCORES gets the mean score of a cluster given the scores of the
0005 % individual points.
0006 %
0007 % INPUTS:
0008 %     clstrs: MxN array. clstrs should be the same size as rangeMatrix.
0009 %     Each element in clstrs is an integer indicating the line cluster the
0010 %     range to which reading belongs.
0011 %
0012 %     scores: MxN array with the score of each element.
0013 %
0014 % OUTPUTS:
0015 %     clstrscores: MxK array where K is the largest cluster number. It
0016 %     contains the mean scores for each cluster.
0017 %
0018 % Abdallah Kassir 1/3/2010
0019 
0020 noscans=size(clstrs,1);
0021 clstrscores=zeros(noscans,max(clstrs(:)));
0022 for cntr1=1:noscans
0023     for cntr2=1:max(clstrs(cntr1,:))
0024         clstrscores(cntr1,cntr2)=mean(scores(cntr1,clstrs(cntr1,:)==cntr2));
0025     end
0026 end

Generated on Thu 08-Apr-2010 14:35:09 by m2html © 2005