If delta_Fx is not scalar, then the output of
will not be scalar either. You need to correctly handle all non-scalar conditions, not just the first one.
However it is quite likely that your approach using if is incorrect anyway. It appears that you are attempting an element-wise operation (which if does not do without a loop), namely replace values whose magnitude lies outside some value range, and so you probably should be doing something like this:
delta_Fx = max(-delta_Fx_max,min(delta_Fx_max,delta_Fx))