I have the following code for
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1332475/image.png)
K=rand(3);
K=K*K.';
b=rand(3,1)-0.5;
C=5;
alpha=optimvar('alpha',numel(b),'LowerBound',0,'UpperBound',C);
prob=optimproblem('Objective',alpha.'*(b.*K.*b')*alpha/2-sum(alpha),...
'Constraints', b'*alpha==0);
sol=solve(prob).alpha
So by repeating the above code 16 times, we get 16 different α i.e., ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1332480/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1332480/image.png)
So is this approach correct ?