How to write the following in CVX?

min ||A(x)-B|| over x and A is a linear mapping

A(x) means A*x for some input matrix A?

If so,

variable x(size(A,2))
% insert any constraints

Have you read the CVX Users’ Guide This is about as straightforward a problem as there is to enter into CVX.

the mapping is a vector x to matrix mapping , that is confusing me , we can’t make it as a multiplication as u wrote , ofcourse i read the guide and had no clue how to solve it

What are the dimensions of x and B? Presumably, A(x) has the same dimensions as B.

If x were a numerically-populated MATLAB (not CVX) variable, what MATLAB code would you use to evaluate A(x)? If you can not answer that, I doubt anyone here can help you. So far, all we know is that A(x) is a mysterious linear map from a vector to a matrix.

Is it something like A being m by n matrix, x being n by 1 vector, B being m by p matrix, and A(x) = repmat(A*x,1,p) ? If so, use minimize(norm(repmat(A*x,1,p)-B))

Whatever it is, if it is a linear map,. and you know how to evaluate it in MATLAB,. you hopefully will be able to code it the same way in CVX when x id declared a CVX variable, as opposed to being a numerically-populated MATLAB variable,.

sir i posted another question its an extension to this with more details , take a look at it , thanks in advance