Compiled Matlab executable, invoked by Window's Task Scheduler, can't locate input .csv file inside current folder

4 visualizaciones (últimos 30 días)
I've successfully compiled a ML script (wrapped by a function) which operates on a .csv file. That .csv file gets overwritten every 10 mins at which time (plus some delay) the script is scheduled by the Window's Task Scheduler to run. The script looks for input.csv in its current directory:
file_in = 'input.csv';
fid = fopen(file_in,'r');
if(~exist(file_in))
error('%s not found',file_in);
endif
But even when input.csv is placed in the same directory as the ML executable, the executable complains that the file doesn't exist when Window Task Scheduler starts the program. If I execute it manually, the script runs as expected without 'file not found' error.

Respuestas (1)

Minh Tran
Minh Tran el 24 de Jul. de 2017
I wasn't able to get the compiled ML application to recognize the .csv file using the path 'input.csv' but the application did recognize it if I specified an absolute path (i.e., C:\MLApp\input.csv)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by