Hello,
I just opened your mex in Tools V4.0 and in Pins view on pin 32, in pins editor(dialog) I unchecked PTD7 and checked the last (n/a,disabled), then 'Done'.
Please see the attached mex with the result.
Also in Sources view in BOARD_InitPins(void) comment you shall see:
- {pin_num: '32', peripheral: n/a, signal: disabled, pin_signal: PTD7/UART0_TX/FTM0_CH1/FTM0_FLT1}
Please let me know what step exactly does not work for you.