I don't have the Optimization toolbox, so I can't really test it out. However, I am pretty sure you are passing your function incorrectly. Try this:
col_myfun = @(x, w) (x'*(w(1)*B+w(2)*eye(size(B,1)))*x);
x = fmincon(col_myfun,...
COL_MYFUN is already a function handle. When you pass it as @(x,w)col_myfun, you are doing making a new function which returns the function handle to another function, not a value. For example:
f = @(x) sin(x);
g = @(x) f;
g(arg) will always return f, never a value! So there may be other problems with your code that I cannot test, but this one definitely needs fixing.