just in case someone need it, I could solve it and I share the code, I haven't finished yet, but my doubt is solved as:
myFolder = 'G:\SWICCA\DATA_validation\ESA\data\daily_files\COMBINED\v02.2\2010\files';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.nc');
theFiles = dir(filePattern);
for i = 1:length(theFiles)
baseFileName = theFiles(i).name;
fullFileName = fullfile(myFolder, baseFileName);
ncid=netcdf.open(fullFileName, 'NC_NOWRITE');
varname= netcdf.inqVar(ncid,4);
varid = netcdf.inqVarID(ncid,varname);
netcdf.close(ncid);
end
Best Answer