1
votes

I want the dendrogram of this data:

tt =  1.0e+03 *

Columns 1 through 5

3.8334    3.9707    3.8887    2.1713    2.5616

Columns 6 through 7

2.3764    2.4533

I use the code in matlab:

tree = linkage(tt,'average');
figure()
dendrogram(tree)

but it gives this error:

Error using linkage (line 137)

The first input does not appear to be a distance matrix because its size is not compatible with the output of the PDIST function. A data matrix input must have more than one row.

What's the problem
and i want the out put to be intervals.is the dendrogram output intervals?

1
at least s.b please tell me can we do something that the output of dendrogram became intervals,numbers like:{{47080, 50280}, {143820, 146820}, {228730, 231330}, {249560, 252170}, {346060, 349220}, {461740, 463540}, {546100, 548810}, {646400, 646960}, {690680, 691120}}; - samdean
That's the correct code. Just transpose tt to make a column vector: tt' - marsei

1 Answers

0
votes

The input to linkage is arranged with rows as observations and columns as variables, but in your example tt is a 1x7 row vector, suggesting a single observation at each of 7 variables. Instead, transpose tt to a column vector if this data represents 7 observations of a single variable, and you can then plot the dendrogram:

% your original tt variable
tt = 1.0e+03 .* [3.8334 3.9707 3.8887 2.1713 2.5616 2.3764 2.4533];
% transpose from row vector to column vector
tt = tt';
% proceed as planned
tree = linkage(tt,'average');
figure()
dendrogram(tree)