Sending negative integers to Arduino from Matlab

Hello everyone.
For my design project, I want to send both negative integers and integers bigger than 255 to arduino from matlab. However, I can only send integers between 0 and 255.
I have searched the forum and could find a couple of topics related to my question but I am not able to implement those solutions in my codes. If you can help me, I wiil be ver happy. Here are my matlab and arduino codes:

Arduino code:

int arrayy[4];
int i=0;

void setup() {
Serial.begin(9600);
}

void loop() {
i=0;
if(Serial.available()>0){
matlabData=Serial.read();
arrayy*=matlabData;*
_ Serial.println(arrayy*);_
_
i++;_
_
}_
Matlab code:
arduino = serial('COM6','BaudRate',9600);
fopen(arduino);
S(1)=-79;
S(2)=79;
S(3)=79;
S(4)=-79;
for i=1:4
_
fprintf(arduino,'%s',char(S(i)))_
_
a(i)=fscanf(arduino,'%d')*_
end
disp(a);
And I read 0 79 79 0 from matlab. Could you please help me?

Your posted sketch turns italic halfway through, thus i suspect did not post correctly. Please read the How to use this forum post at the top to figure out how to fix that.

Thanks!

You must read Robin's Serial Input Basics. It is equally useful for Matlab-to-Arduino as Arduino-to-Arduino.

Hello Kalamar. Did you get a reliable answer to this problem? I am also stuck in a similar situation. I am controlling the Arduino directly from MATLAB using the support package. I need to send positive as well negative integers from MATLAB to Arduino