1. Mex Setup:
2. Select the compiler from the list. You need an external compiler like visual studio installed.
3. Know go to the folder below: Matlab/extern/examples/mex
4. compile it by:
5. Now use it as normal
C = arrayProduct(s,A);
6. If you have error in linking and finding the path, you need to change environment variables of the system TMP and TEMP to a simple path like: C:\temp
7. You can write your own mex by the help of the attached pdf file.