CUDA MEX

Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready.

You are now following this Submission

This small script modifies the files used by MATLAB to compile mex-functions within MATLAB so that CUDA is supported.

Once the script setup_cuda_mex.m is run you can just compile CUDA mex files with the function cuda_mex.m.

Only Win32 with Visual Studio is supported in the current version.
CUDA Toolkit and SDK required.

Cite As

Haim Avron (2026). CUDA MEX (https://uk.mathworks.com/matlabcentral/fileexchange/25314-cuda-mex), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0