mtimesx not work in script

조회 수: 5 (최근 30일)
armita mani
armita mani 2016년 6월 20일
댓글: Laura Galuppi 2021년 11월 24일
Hello
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,

채택된 답변

armita mani
armita mani 2016년 6월 20일
the problem solved by making following changes in mtimesx_build.m:
1.changing mexopts = [prefdir '\mexopts.bat']; to ----> mexopts =[prefdir'\mex_C++_win64.xml'];
2. changing x = findstr(tline,'COMPILER=cl'); to ---> x = findstr(tline,'COMPILER="cl"');
  댓글 수: 2
Elham khn
Elham khn 2021년 4월 28일
Thanks Armita, you paved my way :)
Laura Galuppi
Laura Galuppi 2021년 11월 24일
I tried to do the same thing, but I received an error message:
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII
characters.
Error in mtimesx (line 271)
mtimesx_build;
(the unsupported symbol is the second _ (after C++)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by