K means clustering error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
George Leavitt
el 23 de Nov. de 2016
Respondida: Image Analyst
el 23 de Nov. de 2016
Hello, I am trying to run K means clustering to group different types of clusters in my purchase order history. B represent a 16004 x 4 matrix and A represents a combination of 5 16004 x 1 matrixs. I am attempting to run the script below to view the different clusters.
A = table2cell([Age, Gender, City, Date, Product_ID])
B = cell2mat(A);
IDK = kmeans(B,4)
for k1 = 1:16004
text(B(:,1),B(:,2),B(:,3),B(:,4),B(:,5),num2str(IDK(k1))); hold on;
end
However an error continues to read
Error using text
Too many non-property/value arguments.
Please help! Thank you.
0 comentarios
Respuesta aceptada
Image Analyst
el 23 de Nov. de 2016
Maybe you want fprintf() instead????
fprintf('%f, %f, %f, %f, %f, %f\n', ...
B(:,1),B(:,2),B(:,3),B(:,4),B(:,5), IDK(k1));
0 comentarios
Más respuestas (1)
Walter Roberson
el 23 de Nov. de 2016
Look again at text(). The syntax for text is
text(x, y, strings, ...)
or
text(x, y, z, strings, ...)
so the either the 3rd or 4th argument must be a string or a cell array of strings. Your 4th argument is numeric.
It is not legal in MATLAB to place text at a 5 dimensional coordinate.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!