views:

82

answers:

1

Hi experts, I am trying to read an excel 2003 file which consist of 62 columns and 2000 rows and then draw 2d dendrogram from 2000 pattern of 2 categories of a data as my plot in matlab. When i run the script, it gives me the above error. I don't know why. Anybody has any idea why i have the above error?

My data is here: http://rapidshare.com/files/383549074/data.xls

Please delete the 2001 column if you want to use the data for testing.

and my code is here:

% Script file: cluster_2d_data.m

d=2000;  n1=22;  n2=40;  N=62

Data=xlsread('data.xls','A1:BJ2000');

X=Data';

R=1:2000;

C=1:2;

clustergram(X,'Pdist','euclidean','Linkage','complete','Dimension',2,...

'ROWLABELS',R,'COLUMNLABELS',C,'Dendrogram',{'color',5})
+1  A: 

After xlsread statement you should get double 2000x62 matrix Data. Then you transpose it and assign to X, so X is 62x2000 matrix. In clustergram vectors for RowLabels and ColumnLabels properties suppose to match the size of data matrix. But you pass 2000-length vector as RowLabels and 2-length vector as ColumnLabels. This might cause the error.

What version of Matlab are you using? It looks like pretty old, since you have clustergram as function, but in later versions of Bioinformatic Toolbox it was redesigned as object. In R2010a your code would generate "ROWLABELS size does not match data" error, but I'm not sure what it would be in old version.

Try to remove RowLabels and ColumnLabels, as well as other properties. Will you still get the error?

yuk
I also have my doubts about the property value for `dendrogram`.
Jonas
I have removed the RowLabels and ColumnLabels and the error disappear. Thank Yuk for that suggestion. But why can't i have those lebels and will it make any difference in having the labels or not having it?Thanks
Mola
You surely can have the labels, but their size should match number of rows and columns in your data matrix. Try `R=1:62; C=1:2000;` (although it's the same as default labels).
yuk