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

1 vue (au cours des 30 derniers jours)
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.

Réponses (1)

Minh Tran
Minh Tran le 24 Juil 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)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by