how to Calculate SSE for 20 center

3 views (last 30 days)
shawin
shawin on 17 Apr 2017
Commented: Image Analyst on 17 Apr 2017
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 Comments
Jan
Jan on 17 Apr 2017
The question is not clear.
Image Analyst
Image Analyst on 17 Apr 2017
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?

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!