how to display all of the 'nc' files ? I have total number of 52 files, and when i am run the code, it gives the output as '0*1 struct ' ? The code is given beolw

2 vues (au cours des 30 derniers jours)
file = dir('.nc,')
  2 commentaires
DGM
DGM le 16 Mai 2023
You're looking for one file called '.nc'. You probably should be looking for '*.nc', though a more comprehensive path expression (e.g. including the absolute path prefix) might be more robust.

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 16 Mai 2023
thepath = '' % give you path here
ncfiles = dir([thepath,'\*.nc']) ;
N = length(ncfiles) ; % total files
for i = 1:N
ncfile = fullfile(ncfiles(1).folder,ncfiles(i).name) ;
ncdips(ncfile)
% Load the data use ncread
% do what you want
end

Catégories

En savoir plus sur Agriculture dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by