0

I am trying to use mtimesx library on matlab 2016a, win 10 64bit, I compile this library and the following code runs in command window:

>> a=rand(2,4,2);
>> b=rand(4,5,2);
>> d=mtimesx(a,b)
d(:,:,1) =
      0.5234    0.7756    0.6265    0.7531    0.6579
      0.6256    0.3926    0.3557    0.7522    0.4804
d(:,:,2) =
      0.6398    0.8713    0.8695    0.3040    0.6066
      1.2157    1.0177    1.2590    0.5510    1.1960

but when I'm trying to run it as a script following error occurs:

Undefined function or variable 'mtimesx'.
Error in Untitled2 (line 25)
d=mtimesx(a,b);

and after that this function don't work in command window until I compile it again.

Thank you

A.Mani
  • 71
  • 1
  • 9
  • Sounds like a `path` problem.. mex compilation adds things to a temporary path, which resets if you reset MATLAB. Make sure you put the compiled `.mexw64` files in a folder that belongs to your "static" path. – Dev-iL Jun 20 '16 at 08:37

1 Answers1

0

the problem solved by making following changes in mtimesx_build.m:

1.changing mexopts = [prefdir '\mexopts.bat']; to ----> mexopts =[prefdir'\mex_C++_win64.xml'];

  1. changing x = findstr(tline,'COMPILER=cl'); to ---> x = findstr(tline,'COMPILER="cl"');
A.Mani
  • 71
  • 1
  • 9