**A**, **B**, **X** are all matrices, **A** is semidefinite so I think this question is convex, how can I write it into a form that can be accepted by CVX?

With the conditions stated, this is not necessarily convex, even in the scalar case. For instance, A = 1, B = -1.

In the matrix case, it’s not obvious to me that B (and A) being psd would be sufficient to guarantee convexity; so you’d have to prove it was sufficient.