This paper studies the matrix-scaled resilient consensus problems over multi-agent networks as occurring in computer science and distributed control. Unlike existing works on consensus problems, where the states of agents converge to a common value or reach some prescribed proportions, we take a more general matrix-scaled approach to accommodate the interdependence of multi-dimensional states. We develop a unified analytical framework to deal with matrix-scaled resilient consensus of discrete-time and continuous-time dynamical agents, where the underlying communication network is modeled as a generic directed time-dependent random graph. We propose new distributed protocols to guarantee the matrix-scaled consensus of cooperative agents in the network in the presence of Byzantine agents, who have full knowledge of the system and pose a severe security threat to the collective consensus objective. The cooperative agents feature multiple input and multiple output, and the number and identities of Byzantine agents are not available to the cooperative ones. Our mathematical approach capitalizes on matrix analysis, control theory, graph theory, and martingale convergence. Some numerical examples are presented to demonstrate the effectiveness of our theoretical results.