The two-body scattering amplitude and energy spectrum of confined ultracold atoms are of fundamental importance for both theoretical and experimental studies of ultracold atom physics. For many systems, one can efficiently calculate these quantities via the zero-range Huang-Yang pseudopotential (HYP), in which the interatomic interaction is characterized by the scattering length a. Furthermore, when the scattering length is dependent on the kinetic energy εr of two-atom relative motion, i.e., a = a(εr), the results are applicable for a broad energy region. However, when the free Hamiltonian of atomic internal state (e.g., the Zeeman Hamiltonian) does not commute with the inter-atomic interaction, or the center-of-mass (CoM) motion is coupled to the relative motion, the generalization of this technique is still lacking. In this work we solve this problem and construct a reasonable energy-dependent multi-channel HYP, which is characterized by a "scattering length operator" âeff , for the above complicated cases. Here âeff is an operator for atomic internal states and CoM motion, and depends on both the total two-atom energy and the external field as well as the trapping parameter. The effects from the internal-state or CoM-relative motion coupling can be self-consistently taken into account by âeff . We further show a method based on the quantum defect theory, with which âeff can be analytically derived for systems with van der Waals inter-atomic interaction. To demonstrate our method, we calculate the spectrum of two ultracold fermionic alkaline-earth-like atoms (in electronic 1 S0 (|g ) and 3 P0 (|e ) states, respectively) confined in an optical lattice. By comparing our results with the recent experimental measurements for two 173 Yb atoms and two 171 Yb atoms, we calibrate the scattering lengths a± with respect to anti-symmetric and symmetric nuclear-spin states to be a+ = 2012(19)a0 and a− = 193(4)a0 for 173 Yb, and a+ = 232(3)a0 and a− = 372(1)a0 for 171 Yb.