Info

This question is closed. Reopen it to edit or answer.

Can i know what is the solution for this error

2 views (last 30 days)
Mohammed Magdy
Mohammed Magdy on 8 Oct 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello i found this error in matlab when i'm using kmeans function
Undefined function 'initkm' for input arguments of type 'single'.
Error in kmeans (line 65) center = initkm(cluster_n, data); % Initial cluster centers
  5 Comments
Mohammed Magdy
Mohammed Magdy on 8 Oct 2013
now i'm adding the function initkm i check it in the internet but i don't know the input
function [center, center_class] = initkm(cluster_n, data, data_class) % INITKM Find the initial centers for a K-means clustering algorithm.
% Roger Jang, 990831
% ====== Method 1: Randomly pick cluster_n data points as cluster centers class_n = max(data_class); center = []; center_class = []; for i = 1:class_n, this_data = data(find(data_class==i), :); this_data_n = size(this_data, 1); tmp = randperm(this_data_n); index = tmp(1:cluster_n); center = [center; this_data(index, :)]; center_class = [center_class; i*ones(cluster_n, 1)]; end
dpb
dpb on 9 Oct 2013
Clearly you're not using the Matlab Statistics Toolbox kmeans
Whatever/wherever you obtained it is where to find support for it; the Matlab forum can't help in all likelihood.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!