Thank you both for your replies.
Yes, i just gave it a check to see if Serial.available is bigger than 0 so i know that i have something. I tried to see if i am getting something, or nothing or the same thing all over again. As you said I added the reading to a variable and used it to see what is happening and i wrote a check see if I am getting a -1. But i also changed the analogWrite function to see if i am actually getting to it or i am stuck in my ifs, and no i am actually getting to the analogWrite function.
...
Arr[i]=Serial.read();
}
res = *((float *)&Arr);
analogWrite(11, 255);//<---analogWrite(11, res)
So i am getting a Serial.available bigger than 0, and my reading is a number value and it is not -1. My Guess is that maybe the code is okay, but maybe i am sending wrong data from simulink :/.