Borrar filtros
Borrar filtros

run matlab file from cmd prompt if matlab is already open

2 visualizaciones (últimos 30 días)
Tanner
Tanner el 11 de En. de 2016
Hi,
I'm working on a batch file that lets the user run a matlab program directly from the desktop. However, I want to avoid opening a second instance of matlab if it's already running. My batch file is an if else statement based on whether or not matlab is already running. My question is how can you run the .m file from the batch file, by using the instance of matlab already running?
The line I need help with is in the *???***
tasklist /FI "IMAGENAME eq MATLAB.exe" /NH | find /I /N "MATLAB.exe" >NUL
if "%ERRORLEVEL%"=="0" (
****???****
) ELSE (
cd C:\program files\matlab
matlab -sd N:\matlab -r mfile
)
Thanks!

Respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by