GetNextField - Get next field from a Batch object (iterator mode). This is a helper class to easily read and parse batch files. USAGE [b,field] = GetNextField(b); b batch object
0001 %GetNextField - Get next field from a Batch object (iterator mode). 0002 % 0003 % This is a helper class to easily read and parse batch files. 0004 % 0005 % USAGE 0006 % 0007 % [b,field] = GetNextField(b); 0008 % 0009 % b batch object 0010 0011 % Copyright (C) 2007 by Michaƫl Zugaro 0012 % 0013 % This program is free software; you can redistribute it and/or modify 0014 % it under the terms of the GNU General Public License as published by 0015 % the Free Software Foundation; either version 3 of the License, or 0016 % (at your option) any later version. 0017 0018 function [b,field] = GetNextField(b) 0019 0020 % Check number of parameters 0021 if nargin ~= 1, 0022 error('Incorrect number of parameters (type ''help <a href="matlab:help GetNextField">GetNextField</a>'' for details).'); 0023 end 0024 0025 b.currentField = b.currentField+1; 0026 if b.currentItem < 1 || b.currentItem > size(b.field,1) || b.currentField > size(b.field,2), 0027 field = []; 0028 else 0029 field = b.field{b.currentItem,b.currentField}; 0030 end