Please read the first half of the following thread and see if it helps you.

Here is the answer which hopefully will help you.

mcg Michael C. Grant A more permanent solution is to add the directory cvx/functions/vec_ to your MATLAB path (making sure of course to add the full path)!

Here’s what is going on. vec is a function that converts matrices into vectors. I have it privately defined for @cvx
objects, so that definition doesn’t conflict with anything else. But
it’s also useful for double-precision matrices as well. The problem is
that a lot of other packages define it as well. In order to avoid name
conflicts, I try to add my own version of vec.m only if it isn’t present already in your MATLAB path.

But for some reason, in a few cases out there, my cvx_setup script thinks it sees vec
in your MATLAB path when it’s not there. I really don’t know why that
is. I have simply been unable to reproduce this problem myself. If
someone could figure that out for me, I would be grateful.