Skip to content

Instantly share code, notes, and snippets.

@yonghanjung
Created September 6, 2015 05:00
Show Gist options
  • Save yonghanjung/d7843d1b4c760aef1c9b to your computer and use it in GitHub Desktop.
Save yonghanjung/d7843d1b4c760aef1c9b to your computer and use it in GitHub Desktop.
(2015.09.06) ConvexOpt Hw1 Yonghan Jung
function FunVal = HW1(x, Mat_A, Vec_b )
% A : n dimensional vector, m vectors
% b : b(n by 1)
[m,n] = size(Mat_A);
SumVal = 0;
for idx = (1:n)
Val = Vec_b(idx) - dot(Mat_A(:,idx), x) ;
Val = log(Val);
SumVal = SumVal + Val;
end
FunVal = -SumVal;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment