function U = utility(w, lambda, V, r)

% Portfolio Optimization:
% Utility Function

U = (lambda/2)*w'*V*w-r'*w;