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 (최근 30일)
file = dir('.nc,')
  댓글 수: 2
DGM
DGM 2023년 5월 16일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2023년 5월 16일
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

카테고리

Help CenterFile Exchange에서 Agriculture에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by