how to Calculate SSE for 20 center

2 次查看(过去 30 天)
shawin
shawin 2017-4-17
I have the function bellow:
function y=ObjSSE(x1)
global Dim Data
for i=1:size(x1,1)
c=reshape(x1(i,:),[Dim size(x1,2)/Dim]);
d=dist(Data,c);
d=min(d');
y(i)=sum(d(:));
end
if i x1 = 3.8846 1.9915
2.8583 1.1652
x2 = 5.0831 0.4157
4.1981 1.1693
x3= 3.9004 1.3658
5.1233 0.6420
..... till x10
how can I loop and calculate for x values which are from 1 to 10 and calculate y
ten times and choose the minimum y
  2 个评论
Image Analyst
Image Analyst 2017-4-17
What is SSE? Sum of Squared Errors? I see no squaring going on. x1 is passed in, so we know what that is, but what are x2,x3, ... x10? Is that "if i" statement supposed to be part of the function's code? What are the values of "Dim" and "Data"? Where is your code for the dist() function?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by