First, there is no official command n YALMIP called solvesdp, so you cannot have studied the tutorials
Secondly, your code is trivially vectorizable, so simplify the code to get rid of most if not all for-loops
Third, are you aware that you are setting up nonconvex quadratic models in the second problem? It does not appear so, as you don't tell cplex to search for global solutions
Fourth, it looks like delta0 and delta1 only can 0 or 1, i.e. binary, but you still use an continuous variable to represent it. If you use binaries, you can then linearize the nonconvex bilinear ojective
Fifth, you appear to be using huge big-M constants. Have you really analyzed the problem and shown that those are reasonable values. THey hould be as small as possible. As it is now, you are creating numerically poor models, with weak relaxations. It looks like there are some very simple combinatorial relations between the fai and delta variables
I.e., before even starting here, you have to clean up and simplify the model