"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.

Respuestas (0)

Categorías

Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 12 de Jul. de 2016

Editada:

el 12 de Jul. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by