function [newvarin,newchosen] = Dollychoosefiles(nc) if running(batch) str = get(batch); eval(['nvarin = ' str ';']); for i = 1:nvarin; str = get(batch); eval(['chosen{i} = ' str ';']); end else invars = var(nc); for i = 1:length(invars) eval (['varlist.',name(invars{i}),'={''checkbox'' 0};']) end vlist = varlist; varlist = guido(vlist,'Which variables should be kept?'); nvarin = 0; for i = 1:length(invars) eval (['tf = varlist.',name(invars{i}),'{2};']) if tf nvarin = nvarin+1; chosen{nvarin}=name(invars{i}); end end end % Check for dimension variables. %%% START USGS BOILERPLATE -------------% There is no published documentation for these programs- use the % internal comments and help function. % Programs written in Matlab- as early as 7.2.0.232 (R2006a) and % most recent modifications in v7.8.0 (R2009a) % Programs ran on PC with Windows XP Professional OS, and RHEL4 linux. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%% END USGS BOILERPLATE -------------- dimvars = strvcat('time','time2','depth','lon','lat'); newvarin = 0; for i = 1:nvarin; dimmatch = strmatch(chosen{i},dimvars,'exact'); if isempty(dimmatch) newvarin = newvarin+1; newchosen{newvarin}=chosen{i}; end end if newvarin == 0; newvarin = nvarin; newchosen = chosen; end