getPadSize : returns how many numbers there are in each cell .mat file. INPUT : dirname : directory name handles : used to display the message in the gui. empty for non gui version. OUTPUT : padStr : String of digits in the cell.mat files eg. '%07d' Copyright (C) 2016 Wiggins Lab Written by Paul Wiggins, Stella Stylianidou, Connor Brennan. University of Washington, 2016 This file is part of SuperSegger. SuperSegger is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SuperSegger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SuperSegger. If not, see <http://www.gnu.org/licenses/>.
0001 function padStr = getPadSize( dirname, handles ) 0002 % getPadSize : returns how many numbers there are in each cell .mat file. 0003 % 0004 % INPUT : 0005 % dirname : directory name 0006 % handles : used to display the message in the gui. empty for non gui 0007 % version. 0008 % OUTPUT : 0009 % padStr : String of digits in the cell.mat files eg. '%07d' 0010 % 0011 % Copyright (C) 2016 Wiggins Lab 0012 % Written by Paul Wiggins, Stella Stylianidou, Connor Brennan. 0013 % University of Washington, 2016 0014 % This file is part of SuperSegger. 0015 % 0016 % SuperSegger is free software: you can redistribute it and/or modify 0017 % it under the terms of the GNU General Public License as published by 0018 % the Free Software Foundation, either version 3 of the License, or 0019 % (at your option) any later version. 0020 % 0021 % SuperSegger is distributed in the hope that it will be useful, 0022 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0023 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0024 % GNU General Public License for more details. 0025 % 0026 % You should have received a copy of the GNU General Public License 0027 % along with SuperSegger. If not, see <http://www.gnu.org/licenses/>. 0028 0029 0030 0031 0032 contents = dir([dirname,'*ell*.mat']); 0033 if numel(contents) == 0 0034 if isempty(handles) 0035 disp('No cell files' ); 0036 else 0037 handles.message.String = 'No cell files'; 0038 end 0039 padStr = []; 0040 else 0041 num_num = sum(ismember(contents(1).name,'1234567890')); 0042 padStr = ['%0',num2str(num_num),'d']; 0043 end