A matrix shim system for generating magnetic field components superimposed
on a main static magnetic field, comprising a plurality of annular coils,
is characterized in that it comprises g groups G.sub.1 . . . G.sub.g of
coils, with g being a natural number .gtoreq.1, wherein each group
G.sub.i consists of at least two single annular coils connected in
series, wherein each group G.sub.i is designed to generate, in use, a
magnetic field.function..infin..times..times..times..function..times..tim-
es. ##EQU00001## For each group G.sub.i, there are at least two values of
n for which.times..times..function..times..function..times..times..times.-
.function..gtoreq..times..times..times..times..gtoreq..gtoreq.
##EQU00002## with N: the total number of current supplies of the matrix
shim system, and R: smallest inside radius of any of the annular coils of
the matrix shim system. An individual, adjustable electrical current
supply is provided for each group G.sub.i of coils. The inventive matrix
shim system is both simple in design and stable against current
fluctuations.