how to get the values from netcdf to ascii format through matlab?

2 ビュー (過去 30 日間)
Gargi
Gargi 2014 年 8 月 13 日
コメント済み: Gargi 2014 年 8 月 15 日
The data is in .nc form (e.g data.nc). 1) How to extract a grid from this file format? 2) How to find the values of the extracted grid in ascii form?
  2 件のコメント
Ashish Uthama
Ashish Uthama 2014 年 8 月 13 日
Girija, please say more. Its hard to give a helpful answer since your question does not have enough information. For example - how is the data in the netcdf file structured? Do you have lat /lon and data. Are they 1D 2D or nD? What do you mean by ASCII form? As a variable as a CSV file a text file?
To get started, please have a look at the ncread function.
Gargi
Gargi 2014 年 8 月 14 日
Sir, data is in .nc format (data.nc) (temperature data of two years 1948-1949). Its a global data, ve to extract a grid from that data, and the value should be in ascii (csv ) form. I have to read this data and make a average of January month, February month and so on...of two years.
Sir, this data have longitude, latitude, time, and temperature of one pressure level i.e 1000.

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

採用された回答

Chad Greene
Chad Greene 2014 年 8 月 13 日
Check out the names of the variables with ncdisp('data.nc') and if one of the variables is lat, you can load it with
lat = ncread('data.nc','lat');
Then you can write variables to ascii with dlmwrite.
  1 件のコメント
Chad Greene
Chad Greene 2014 年 8 月 13 日
It is difficult to understand your question. Try to ask a specific question about a specific step that you're having trouble with.

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

その他の回答 (1 件)

Supreeth Subbaraya
Supreeth Subbaraya 2014 年 8 月 14 日
Take a look at the function ncread. Here you can specify the indices of the starting location of a variable and the number of elements to be read. If a variavle "var" is a two dimensional variable, then you can use the following line of code:
ncread('data.nc','var',[1, 1], [1,1])

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by