Home > FMAToolbox > Database > CancelBatch.m

CancelBatch

PURPOSE ^

CancelBatch - Cancel batch job.

SYNOPSIS ^

function CancelBatch(batch)

DESCRIPTION ^

CancelBatch - Cancel batch job.

  USAGE

    CancelBatch(batch)

    batch          batch parameter returned by <a href="matlab:help StartBatch">StartBatch</a>

  SEE

    See also StartBatch, GetBatch, BatchInfo, CleanBatches, Store, Recall.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function CancelBatch(batch)
0002 
0003 %CancelBatch - Cancel batch job.
0004 %
0005 %  USAGE
0006 %
0007 %    CancelBatch(batch)
0008 %
0009 %    batch          batch parameter returned by <a href="matlab:help StartBatch">StartBatch</a>
0010 %
0011 %  SEE
0012 %
0013 %    See also StartBatch, GetBatch, BatchInfo, CleanBatches, Store, Recall.
0014 %
0015 
0016 % Copyright (C) 2010-2011 by Michaƫl Zugaro
0017 %
0018 % This program is free software; you can redistribute it and/or modify
0019 % it under the terms of the GNU General Public License as published by
0020 % the Free Software Foundation; either version 3 of the License, or
0021 % (at your option) any later version.
0022 
0023 % Check number of parameters
0024 if nargin < 1,
0025     error('Incorrect number of parameters (type ''help <a href="matlab:help CancelBatch">CancelBatch</a>'' for details).');
0026 end
0027 if prod(size(batch)) ~=1 || ~isa(batch,'timer') || ~isvalid(batch) || ~strcmp(get(batch,'Tag'),'BatchJob'),
0028     error('Incorrect parameter (type ''help <a href="matlab:help CancelBatch">CancelBatch</a>'' for details).');
0029 end
0030 
0031 k = input('Are you sure you wish to cancel this batch (y/N)? ','s');
0032 if isempty(k) || ~strcmp(lower(k(1)),'y'), return; end
0033 
0034 delete(batch);

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005