i2c matlab

Hello i have a this imu Pololu - MinIMU-9 v2 Gyro, Accelerometer, and Compass (L3GD20 and LSM303DLHC Carrier) , i need read the data from this sensor to the matlab using the serial communication , but i dont know how to call the port i2c to the matlab , i have a leonardo board.

i need call the following variables compass.a.x and compass.a.y. somebody can tell me how to do it?

#include <Wire.h>
#include <L3G.h>
#include <LSM303.h>
#include <hardware/tools/avr/avr/include/math.h>
//#include <math.h>
L3G gyro; // declara el giroscopio
LSM303 compass; // declasa el accelerometro y magnetometro

int C; //cuadrante
int in_1=10;//PWM1
int in_2=11;//PWM2
int w;//ACELERACION

void setup()
{

Serial.begin(9600); // inicia la comunicacion i2c
Wire.begin();

if (!gyro.init()) //HABILITA EL GIROSCOPIO
{
Serial.println("Failed to autodetect gyro type!");
while (1);
}

gyro.enableDefault();

compass.init(); //habilita el accelerometro y el magnetometro
compass.enableDefault();

pinMode(in_1,OUTPUT);
pinMode(in_2,OUTPUT);

}

void loop() {

for(w=150;w<=255;w++){

//ADQUISICIÓN DE DATOS//
compass.read(); //lee el magnetometro y accelerometro
delay(100);

if (compass.a.x>0 && compass.a.x<1100 && compass.a.y>-1100 && compass.a.y<0){
C=1;}

if (compass.a.x>0 && compass.a.x<1100 && compass.a.y>0 && compass.a.y<1100){
C=2;}

if (compass.a.x>-1100 && compass.a.x<0 && compass.a.y>0 && compass.a.y<1100){
C=3;}

if (compass.a.x>-1100 && compass.a.x<0 && compass.a.y>-1100 && compass.a.y<0){
C=4;}

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

//CONTROL-PWM//
analogWrite(in_1,w);
digitalWrite(in_2,LOW);
delay(10);

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

//COMUNICACIÓN SERIAL//
Serial.print("Sx=:");
Serial.print((int)compass.a.x);
Serial.print(" ");
Serial.print("Sy=:");
Serial.print((int)compass.a.y);
Serial.print(" ");
Serial.print("Cuadrante=:");
Serial.print(C);
Serial.print(" ");
Serial.print("PWM=:");
Serial.println(w);

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

}

// }

}

Hey

I think there is an easy soluion, you could connect your sensor to a microcontroller Arduino for example , write a code to read the sensor.

then use these tutorials

Hope this helps