a = arduino('COM4','Uno');
dev = i2cdev(a,'0x48');
data = readRegister(dev,0,'uint16');
This code will measure the signal from the A0 channel of the ADS1115, up to 1.024 Volts. To use a voltage above 1.024 Volts you can write a different number to the register. As far as I know, you need to call the writeRegister command every time before you read the data with readRegister.
How to make the chip work (with more detail)
First you need to tell the ADS1115 to start gathering data. You do this by writing a value to the configuration register (the number 1 in the writeRegister command corresponds to the config register). The number that you write to the register can be worked out by looking at the ADS1115 data sheet, in the section "Config Register Field Descriptions". Basically you need to work out a 16-bit binary sequence.
The values that I used as an example:
For example in the bits 11 to 9 I used "0 1 1", this corresponds to the gain amplifier setting of FSR = +/- 1.024 V from the data sheet. By gathering these 1's and 0's into a single 16-bit sequence (starting with bit 15 from my table) we get:
We can then convert this sequence into a decimal number with:
This gives 51075. After writing this value to the configuration register, the chip will start gathering data. This will be stored in the conversion register (which has address 0). We can read the data from this register by using the readRegister command.
n.b. sorry for necroing this thread. There is literally no documentation on the internet on how to use this chip with Matlab / Arduino, and this is the first thing that comes up on google. I spent around 10 hours getting this to work, and I want other users to not have the same painful experience :)