In this article, the problem of consensus of linear multiagent systems (MASs) with both uncertain dynamics and uncertain switching topology is investigated. Uncertainties are considered as granular fuzzy numbers that are represented via horizontal membership functions and relative distance measurement (RDM) arithmetic. It is first proved that there exists a crisp solution to a fuzzy linear matrix inequality (LMI) problem. This proof creates a bridge such that multidimensional RDM arithmetic that has been devoted to linear functions so far could be entered into some problems with nonlinear functions. Then, an algorithm is proposed for the consensus of the MASs with uncertainty. Here, by proving the existence of a crisp solution for fuzzy LMI, we are able to prove that the proposed algorithm can ensure achieving consensus. Furthermore, the gain coefficients obtained for this fuzzy system are crisp numbers and can be applied to real systems in practical applications. Finally, the final value of consensus is calculated as a fuzzy number to present a better understanding of the effect of uncertainty on the final value of consensus. In addition, the efficiency of the proposed algorithm is shown in a simulation example.