Magnetic filter for food and plastics