Quantum states of a few-particle system capacitively coupled to a metal gate can be discriminated by measuring the quantum capacitance, which can be identified with the second derivative of the system energy with respect to the gate voltage. This approach is here generalized to the multivoltage case, through the introduction of the quantum capacitance matrix. The matrix formalism allows us to determine the dependence of the quantum capacitance on the direction of the voltage oscillations in the parameter space and to identify the optimal combination of gate voltages. As a representative example, this approach is applied to the case of a quantum dot array, described in terms of a Hubbard model. Here, we first identify the potentially relevant regions in the multidimensional voltage space with the boundaries between charge stability regions, determined within a semiclassical approach. Then, we quantitatively characterize such boundaries by means of the quantum capacitance matrix. Altogether, this provides a procedure for optimizing the discrimination between states with different particle numbers and/or total spins.