from Example of CUDA and MATLAB and nothing else (for Windows) by Paul
A simple example that creates a MEX file which calls CUDA to add two length-5 vectors

my_compile(varargin)
function my_compile(varargin)
!"%VS90COMNTOOLS%vsvars32.bat" & nvcc -c -arch compute_13 test.cu
n=getenv('CUDA_LIB_PATH'); if n(1)=='"', n=n(2:end); end, if n(end)=='"', n=n(1:end-1);end
mex(['-L' n],'-lcudart','test.obj',varargin{:});

Contact us at files@mathworks.com