Why does KMEANS give an error when using integer data types?
조회 수: 7 (최근 30일)
이전 댓글 표시
When I attempt to cluster my integer data using KMEANS, I receive the following error
??? Error using ==> minus
Integers can only be combined with integers of the same class, or scalar doubles.
채택된 답변
MathWorks Support Team
2010년 6월 28일
This error is the expected behavior for passing an integer data type to the KMEANS function. KMEANS and many other statistical functions are not designed to work with integer data in MATLAB 7.2 (R2006a).
The only workaround is to convert the integer data to a double data type before passing it to KMEANS. For more information, refer the following documentation page on the DOUBLE function:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/double.html>
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!