I’m also new to HTM and I also intend to do the same.
I think we should implement a custom encoder that takes the two varyables as input in order to do that. Take a look at the CoordinateEncoder and try to figure it out. In order to implement a custom Encoder you should inherit from Encoder class.
Found this topic on writing your own custom Encoder: [Writing a custom encoder](http://Writing a custom encoder)
Bellow is a scheleton of a custom Encoder automatically generated by Netbeans:
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.numenta.nupic.examples.napi.hotgym; import java.util.List; import org.numenta.nupic.encoders.Encoder; /** * * @author My Self */ public class MyCustomEncoder extends Encoder{ @Override public int getWidth() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public boolean isDelta() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void encodeIntoArray(Object inputData, int[] output) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public List getBucketValues(Class returnType) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }