fncname: One line description. CTD Calibration toolbox INPUT: input: Desc input OUTPUT: theResult: Desc output DESCRIPTION: CHANGELOG: 08-Jul-2004, Version 1.0 * Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Count the number of space separated columns in a string.
0001 function theResult = functiontemplate(varargin) 0002 % fncname: One line description. 0003 % 0004 % CTD Calibration toolbox 0005 % 0006 % INPUT: 0007 % input: Desc input 0008 % 0009 % OUTPUT: 0010 % theResult: Desc output 0011 % 0012 % DESCRIPTION: 0013 % 0014 % 0015 % CHANGELOG: 0016 % 08-Jul-2004, Version 1.0 0017 % * Initial version. 0018 % 0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 function nCols = count_space_separated_cols(line); 0022 % Count the number of space separated columns in a string. 0023 % 0024 i = 1; 0025 while line 0026 [junk,line] = strtok(line,' '); 0027 i = i + 1; 0028 end 0029 nCols = i-1; 0030 return 0031 0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0033 function [theCell] = parseToCell(line,nCols) 0034 % parseToCell: Parse the line into individual elements of a cell array. 0035 % 0036 i = 1; 0037 theCell = cell(nCols,1); 0038 while line 0039 [theCell{i},line] = strtok(line,' '); 0040 i=i+1; 0041 end 0042 return 0043