"Matlab runtime not found" (MCR) error when running from a .bat file

I turned one of my matlab functions into an executable by using the mcc -e myMatlab.m command. When I then open a windows command prompt, and run my function:
C:\Users\Alex\myMatlab.exe
The .exe runs with no issues.
However, if I try to run myMatlab.exe from a .bat file, I get the following error: "Could not find version 9.0 of the MATLAB Runtime. Attempting to load mclmcrrt9_0.dll." etc etc. Even though the only line in my .bat file is "C:\Users\Alex\myMatlab.exe" Given this (and the fact that I just compiled the .exe on the same machine I'm trying to run it on) I figure that somehow when the windows shell is opened via the .bat file it cannot find the matlab MCR. But I do not understand why or how i can fix that. Any help is much appreciated.
The ultimate goal, btw, is to run this matlab function from vba. But when it wasn't working from there I tried running it through a .bat file.

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2016년 7월 12일

편집:

2016년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by