"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