我收到一个使用 FCM 无法理解的错误。
如果我设置文档中提到的选项,它会输出此错误:
??? Error using ==> zeros
Leading inputs must be numeric.
Error in ==> fcm at 83
obj_fcn = zeros(max_iter, 1); % Array for objective function
Error in ==> fcm at 82
[centers, U, objFun] = fcm(data, 6, 'options');
如果我删除代码运行正常的选项,这里是完整的代码:
[centers, U, objFun] = fcm(data, 6, 'options');
plot(data(:,1), data(:,2),'o');
maxU = max(U);
index1 = find(U(1, :) == maxU);
index2 = find(U(2, :) == maxU);
line(data(index1,1),data(index1, 2),'linestyle','none',...
'marker','*','color','g');
line(data(index2,1),data(index2, 2),'linestyle','none',...
'marker', '*','color','r');