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

조회 수: 4 (최근 30일)
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.

답변 (1개)

Minh Tran
Minh Tran 2017년 7월 24일
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)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by