필터 지우기
필터 지우기

read many ncdata using ncread

조회 수: 5 (최근 30일)
주희 박
주희 박 2022년 9월 23일
답변: KSSV 2022년 9월 23일
Hi, I have several mobthly ncdata. And their names are consised of date.
* But I got an error when i tried to atteached NC file. So I couldn't. So sorry.
For example, NCdata_100_200001 , NCdata_100_200002 ...
And I got variables like below
latent=ncread("NCdata_100_200001.nc4",'EFLUX'); %I'm trying to calculate latent heat flux
lon=ncread("NCdata_100_200001.nc4",'lon');
lat=ncread("NCdata_100_200001.nc4",'lat');
time=ncread("NCdata_100_200001.nc4",'time');
But I have to calculate data over 20 years. So If i use that code, I have to change the name of file respectively.
Can I import ncfiles in simple code?
  댓글 수: 1
CHIRANJIT DAS
CHIRANJIT DAS 2022년 9월 23일
@주희 박 This Link have the answer that you are looking for.

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

채택된 답변

KSSV
KSSV 2022년 9월 23일
ncfiles = dir('*.nc') ;
N = length(ncfiles) ;
for i = 1:N
thisfile = ncfiles(i).name ;
% do your calculation
end

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by