variable dimension change nc file

2 ビュー (過去 30 日間)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2017 年 8 月 28 日
コメント済み: KSSV 2017 年 8 月 30 日
I have downloaded era specific humidity data in .nc file.In that data specific humidity as a variable is present ant that is 4x3x4x9862 where 4=lon,3=lat,4=pressure level and 9862=time.Now I am creating a nc file where I want this in format 3x4x4x9862 where 3=lat,4=lon,4=pressure level and 9862=time. I have written a programme and create variable for nc file like that
nccreate('test_files.nc','q','Dimensions',{'lat' 3 'lon' 4 'lev' 4 'time' 9862 });
ncwrite('test2_files.nc','q',q(3,4,4,9862));
but
error Attempted to access q(3,4,4,9862); index out of bounds because
size(q)=[4,3,4,9862].
How can I solve the problem?
  6 件のコメント
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2017 年 8 月 29 日
I have worked on matlab2015.ncwrite('test2_files.nc','q',q(3,4,4,9862)); giving error message.
KSSV
KSSV 2017 年 8 月 30 日
In that case..write a matrix in loop.....write q(:,:,:,i) at a loop i.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by