function [ del ] = step3_KKT(n,m)
%Step3_KKT - Running step 3
%{
Detailed explanation goes here
%}
X = sdpvar(n,1);
Y = sdpvar(m,1);
Z = kron(X,Y);
sdisplay(Z)
f = kron(Z,Z);
Z = reshape(Z, [m,n]);
for i=1:n-1
for k=i+1:n
for j=1:m-1
for l=j+1:m
a = Z(i,j)*Z(k,l);
b = Z(i,l)*Z(k,j);
c = a-b;
disp(class(c))
end
end
end
end
end
Somehow taking the difference of two sdpvar objects, returns a double object. As it can be seen, I need to be able to do this for arbitrary (n,m)>(3,3).
I have tried writing down "c=sdpvar(a-b)", but that doesn't help either.
Do you have any advice on how I can do this? Is there something wrong in my code?
More specifically, I need the gradient of these minors for implementing KKT conditions. I imagine I can do this by somehow looping over i,j,k,l and using blkvar, or perhaps even the jacobian commands.
If you have any advice on how I might do this, it would be much appreciated.
Best,
Abhishek B.