good point, I need to rethink this a bit probably.
My problem is, I need to use fmincon to maximize distance between 6 points on a unit sphere in R^3. I need in some way find an expression for calculating the distance from every point to every other point?
I just thought maybe it would be easiest in some way if I were to put the different points in a matrix or something..
Also obv, I need to write a nonlinear constraint function.
I guess it would be something like:
c= %No less than constraints
ceq=x(1).^2 + x(2).^2 + x(3).^3 - 1
But I need this constraint for 6 points..
I am having a bit trouble with this. Need a bit more guidance.
y=-norm([x(k,1)-x(k-1,1) x(k,2)-x(k-1,2) x(k,3)-x(k-1,3)])
This is supposed to be the function calculating distance.
%A=[1 0 0;-10 0 0]
norm(X(1,) %DOES NOT EQUAL ONE, not working
ceq=x(1).^2 + x(2).^2 + x(3).^2 -1;