The simultaneous problem of consensus and trajectory tracking of linear multi-agent systems is considered in this paper, where the dynamics of each agent is represented by a single-input single-output linear system. In order to solve this problem, a distributed control strategy is proposed in this work, where the trajectory and the formation of the agents are achieved asymptotically even in the presence of switching communication topologies and smooth formation changes, and ensuring the closed-loop stability of the multi-agent system. Moreover, the structure and dimension of the representation of the agent dynamics are not restricted to be the same, as usually assumed in the literature. A simulation example is provided in order to illustrate the main results.