connection between matlab and arduino mega2560 via bluetooth

Hello everyone,
I'm trying to send string data from matlab to arduino via bluetooth HC-05, but I have several problems.
Here is a part of the matlab code that sends the string:
for object = 1:length(stats1)
bb1 = stats1(object).BoundingBox;
bc1 = stats1(object).Centroid;
rectangle('Position',bb1,'EdgeColor','r','LineWidth',2)
plot(bc1(1),bc1(2), '-m+')
a=text(bc1(1)+15,bc1(2), strcat('X: ', num2str(round(bc1(1))), ' Y: ', num2str(round(bc1(2)))));
set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'yellow');
X=num2str(bc1(1))
Y=num2str(bc1(2))
fprintf(bt,'%s', X);
pause(1);
fprintf(bt, '%s', Y);
pause(1);

end

and this is my arduino code to read this data:

if (Serial1.available()&& c==0) {
text = Serial1.readString();
if(text=="end")
c++;
else{
if(i==1){
Xr=text.toInt();
i++;
Serial.println(Xr);
}

Now, the problem is that I receive 0s on serial monitor although data is coordinates of a robot and shouldn't be 0.
I will be glad if anyone would help me with this problem.