MATLAB: Reading Netcdf in a loop

netcdf

Good day guys,
Please I want this code in the attached file to read the data in the subfolders.
thank you for being there

Best Answer

When you are using ** then the files will not be in projectdir, they will be in a subfolder of it. So you need to replace
filenames = fullfile( projectdir, {dinfo.name} );
with
filenames = fullfile( {dinfo.folder}, {dinfo.name} );
The folder field did not exist for older MATLAB, but those older MATLAB did not support ** subfolder searches either.