Thursday, March 14, 2019

[Solved]Matlab Clustergram error: Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf

I was calling clustergram() and got these errors:

Error using clustergram>computeDendrogram (line 1279)
Encountered error while computing hierarchical clusters:
Value must be a 1x2 vector of numeric type in which the
second element is larger than the first and may be Inf
Error in clustergram/computeClusters (line 909)
        [Z1, H1, ~, perm1] = computeDendrogram(data,...
Error in clustergram (line 413)
        computeClusters(obj);


The cause was: I accidentally gave it a 1Xn vector for clustering
Why I got a 1Xn vector?
Because I was using table2array to concert a variable that was already an array

No comments:

Post a Comment