By considering a new metric, Nikov and Nikova defined the class of error-set correcting codes. These codes differ from the errorcorrecting codes in the sense that the minimum distance of the code is replaced by a collection of monotone decreasing sets ∆ which define the supports of the vectors that do not belong to the code. In this paper we consider a subclass of these codes - so called, ideal codes - investigating their properties such as the relation with its dual and a formula for the weight enumerator. Next we show that the ∆-set of these codes corresponds to the independent sets of a matroid. Consequently, this completes the equivalence of ideal linear secret sharing schemes and matroids on one hand and linear secret sharing schemes and error-set correcting codes on the other hand.