The VU-Kinect block for Simulink streams the color and depth video signals from the Microsoft Kinect sensor into the Simulink environment so that non-developers can access the capabilities of the sensor and leverage Simulink’s powerful tools for image processing and analysis.
Unlike some other Windows-based toolboxes, the VU-Kinect block is based on the open-source libfreenect driver for Linux-based systems. Real-time code, and operation using External Mode is possible, and the system has been successfully tested on Linux PC as well as PandaBoard target hardware.
It will be suitable for you to create the same VU-Kinect for Windows
Please note that your S-function creates a separate thread which then interacts with the MATLAB desktop (the MEX headers #define printf as mexPrintf, which qualifies as interacting with the MATLAB environment). This is an unsafe operation. If you create a separate thread from a MEX-file it may not interact with the MATLAB environment.
I've tried it on a Mac, but the libraries are no longer accessible. I get an error:
sudo: add-apt-repository: command not found
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.