Reliable gas sensing with memristive array