Matlab and Arduino interfacing using serial communication

I have interfaced Matlab and Arduino and written code .I checked my serial communication first by using serial monitor it returns result to monitor but when I attached matlab by opening COM port from matlab and creating arduino object for serial communication to arduino.When i write command of sending data to arduino

fprintf(arduino,'%d',d)

the arduino doesnot respond to and does not print on lcd while when i send to it from serial monitor it prints and secondly i have built a function of sendserial in matlab which send data to arduino.But when i write individually the command fprintf(arduino,'%d',d) on command window of matlab with condition in arduino sketch that if it recieve 31 it turns on LED pin 13 then it responds and turn on the LED.Please help me what is the problem?
But it doesnot call my fucntions in arduino sketch when recieving data.

here is my arduino code

void loop()
{
int b[6]={
0,0,0,0,0,0 };
if(Serial.available()>0) // if there is data to read
{

matlabData=Serial.parseInt() ;
dec2bin(matlabData,b);
sprint(b);

}

}

these function are not called when it recieves data form matlab functions sendserial

matlabData=Serial.parseInt() ;
dec2bin(matlabData,b);
sprint(b);

sprint(b) function prints data to lcd

these function are not called when it recieves data form matlab functions sendserial

You've provided no proof of that. You've not shown all of your code. What you did post, you posted incorrectly. You've not said whether or not the RX LED blinks. You, therefore, can not reasonably expect help.

Sorry for that, Yes of course it blinks the RX pin light but then it does not call my function and print lcd.

There are dozens of Threads here about Matlab - Google will find them for you.

The examples in serial input basics show simple reliable ways to receive data.

...R

Yes of course it blinks the RX pin light but then it does not call my function and print lcd.

If the RX LED blinks, data arrived. The problem then is that the data is not what you expect. Since you have an LCD, you have an opportunity to see what the data actually IS. Then, write your code to deal with what you actually get.