Warning messages preventing MATLAB from running from Task Scheduler?

1 view (last 30 days)
I've got a script that runs every day via Windows Task Scheduler. Part of the script uses griddata to interpolate a matrix from a uneven scattered grid to a grid specified by meshgrid. There are occasionally duplicate x-y points in the uneven grid, and this is unavoidable. When I run the program manually, I get a simple warning message, "Warning: Duplicate x-y data points detected: using average of the z values." and the program continues. When I run from Task Scheduler, I get the following error message in the logfile:
{Warning: Duplicate x-y data points detected: using average of the z values.}
{> In <matlab: opentoline('C:\Program Files\MATLAB\R2011b\toolbox \matlab\polyfun\griddata.m',99,1) griddata at 99>
In <matlab: opentoline('C:\modis\Step1_Interpolation.m',395, 1) Step1_Interpolation at 395>
In <matlab: opentoline('C:\Program Files\MATLAB\R2011b\toolbox\ matlab\lang\run.m',57,1) run at 57>
In <matlab: opentoline('C:\modis\Step0_Download_and_Main_ Process.m',140,1) Step0_Download_and_Main_Process at 140>}
{Error using <matlab:helpUtils.errorDocCallback('griddata', 'C:\ Program Files\MATLAB\R2011b\toolbox\matlab\polyfun\griddata.m', 112)" style ="font-weight:bold griddata> (<matlab: opentoline('C:\Program Files\MATLAB\R2011b\toolbox\matlab\polyfun\griddata.m',112,0) line 112>)
Not enough unique sample points specified.
Error in <matlab:helpUtils.errorDocCallback('Step1_ Interpolation', 'C:\modis\Step1_Interpolation.m', 395)" style="font-weight:bold Step1_Interpolation> (<matlab: opentoline('C:\modis\Step1_Interpolation.m',395,0) line 395>)
U = griddata(LonU,LatU,U,LonGrid,LatGrid);
Error in <matlab:helpUtils.errorDocCallback('run', 'C:\Program Files\MATLAB\R2011b\toolbox\matlab\lang\run.m', 57)" style="font-weight: bold run> (<matlab:opentoline('C:\Program Files\MATLAB\R2011b \toolbox\matlab\lang\run.m',57,0) line 57>)
evalin('caller', [s ';']);
Error in <matlab:helpUtils.errorDocCallback('Step0_Download_and_Main _Process', 'C:\modis\Step0_Download_and_Main_Process.m', 140)" style="font-weight:bold Step0_Download_and_Main_Process> (<matlab: opentoline('C:\modis\Step0_Download_and_Main_Process.m',140,0) line 140>)
run('C:\modis\Step1_Interpolation.m')
}
And the program quits. I had a similar problem before trying to run urlread in a MATLAB script run from Task Scheduler. I eventually solved the problem by adding "status" as an output variable, which supressed the output of error messages. Since the problem seems to be connected to error and warning messages, I can only guess that supressing them leads to a solution. But is there a better way? I admit that I'm not too familiar with this area of MATLAB. Can someone explain why this is happening and how I can fix it? Thanks!
If it helps, here is the initialization parameters used in Task Scheduler:
Program Script: "C:\Program Files\MATLAB\R2011b\bin\win64\MATLAB.exe"
Arguments: -r Step0_Download_and_Main_Process;quit -logfile "C:\modis\Main_Logfile.txt"
Start In: C:\modis

Accepted Answer

Jan
Jan on 24 Apr 2013
Beside the warning, you get an error message also:
Not enough unique sample points specified.
When this is the case, how could Matlab proceed successfully? It seems like the input values, you process in the scheduled task, are not valid.
  1 Comment
Andrew
Andrew on 24 Apr 2013
You are right, I just discovered it. Apparently I had accidentally overwritten one of the input files earlier in the day.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!