add computation of tign2ros via grad function
[wrf-fire-matlab.git] / netcdf / ncreadandcat.m
blob8bce1d8af064c847cb022acff1c913630bf295d2
1 function h=ncreadandcat(files,vars)
2 % h=ncreadandjoin(files,vars)
3 % in 
4 %      files      cell array, names of files to read
5 %      vars       cell array, names of variables to read 
7 % out 
8 %      h          h.vars{i} contains the variable, concatenated along the last dimension 
10 for i=1:length(files)
11     [f,dims]=nc2struct(files{i},vars,{});
12     if ~exist('h','var'),
13         h=f;
14     else
15         for j=1:length(vars)
16             field=lower(vars{j});
17             n=length(dims.(field));
18             h.(field)=cat(n,h.(field),f.(field));
19         end
20     end
21 end
22 h.filename=files;
23