What type of Arduino is the software from mathworks supposed to work with?
Since the sketch suffix is pde, it makes me think it is not intended for the Due, the sketch suffix was changed to ino some time ago.
Straighten out the type conversion problems first, they may be causing some of the other issues. An int is 32 bits on a Due and 16 bits on any other Arduino which are based on AVR architecture instead of ARM. You can find the data type sizes in the Arduino reference http://arduino.cc/en/Reference/HomePage
You may find more help at the MATLAB site if there aren't a lot of MATLAB users here.