1. A method for adjusting resistance in a device, wherein the device comprises two magnetic elements (FM 1 , FM 2 ) separated by an insulating element or semi-conductor (I), the resistance of the device being dependent on the position of a magnetic wall in one of the magnetic elements (FM 1 ), the magnetic wall separating two areas of said magnetic element each having a separate homogeneous direction of magnetization, said device including means for moving the magnetic wall in said magnetic element (FM 1 ) by applying a spin-polarized electric current (i E ), the method comprising: injecting the spin-polarized current (i E ) through the magnetic wall; moving the magnetic wall in a continuous range between a minimum resistance and a maximum resistance; and continuously adjusting the resistance in the device, wherein the minimum resistance is determined when magnetization directions of the two magnetic elements (FM 1 , FM 2 ) are parallel with respect to each other and the maximum resistance is determined when the magnetization directions of the two magnetic elements (FM 1 , FM 2 ) are opposite with respect to each other.