It's difficult to debug your code without seeing the error message that you're getting. However, I can provide some general feedback on your code.
The variable ueCh is computed as follows:
ueCh = env.powerUAV.*reshape(RL.alpha_AtG(i,2:end,:),env.numUAV,env.numFreq).*RL.freqUAV;
This seems to assume that the UAV is transmitting to the UE, but in the next line, you use ueCh(i-1,:) as the signal power, which doesn't seem to make sense.
The variable crossInter is computed as follows:
crossInter = env.powerMBS.*reshape(RL.alpha_AtG(i,1,:),1,env.numFreq).*sum(RL.freqMBS,1);
This seems to assume that the MBS is transmitting to the UE, but in the previous line, you used ueCh to compute the signal power. You need to make sure that you're computing the interference power correctly.
The variable RL.rate is computed as follows:
RL.rate = sum(RL.rate,2);
RL.rate(2:end,1) = min(RL.rate(2:end,1),RL.bhRate);
This seems to assume that RL.rate is a 2D matrix, but it's actually a 1D vector. You should remove the sum function call.
Overall, I would recommend going through your code carefully and double-checking that you're using the correct variables and that you're computing the signal and interference powers correctly. You might also want to add some print statements to help with debugging.