How to print data from many netCDF files to one text file?

3 ビュー (過去 30 日間)
Lexie Wilson
Lexie Wilson 2016 年 7 月 25 日
回答済み: Walter Roberson 2016 年 7 月 25 日
I have about 150 cdf files, each containing 9 variables. I would like to put the values for each of the 9 variables into columns in an array (that I will export as a .txt file).
So far I can read the variables from the .cdf file using ncread
time = ncread(path,'time');
but I can only do one file at a time. Is there a way I can cycle through all the .cdf files and copy the value of each variable into a text file (tab delimited)?

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 7 月 25 日
Note: please do not name a variable "path" as that is the name of the MATLAB path variable and changing its value can lead to a lot of problems.

カテゴリ

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