Saving MATLAB Workspace to NetCDF File

3 ビュー (過去 30 日間)
Brad
Brad 2011 年 12 月 21 日
Hi,
Is there a simple command to save your MATLAB workspace (all variables, arrays, etc) to a NetCDF file? For example, something as simple as " save('workspace',-netcdf) " , or something similar.
Then, I want to be able to open this NetCDF file in a different programming environment which supports NetCDF, and be able to access the variables and arrays. I'm either looking for a direct "save-as-netcdf" command, or a ".mat-to-netcdf" conversion script.
Any help is appreciated, thanks!
  1 件のコメント
Walter Roberson
Walter Roberson 2011 年 12 月 21 日
This would be somewhat tricky for objects and handles and inline functions and symbolic expressions and function handles.

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

回答 (1 件)

Ashish Uthama
Ashish Uthama 2011 年 12 月 22 日
Brad, From what I know, your best bet would be to write one.
The nccreate and ncwrite function can make it easy to write out the basic datatypes as netcdf variables.
  1 件のコメント
Brad
Brad 2011 年 12 月 23 日
I haven't found anything solid either. I think you're right - writing one myself is my best bet. If I do end up writing one, maybe I can submit it to MathWorks' user-submitted file/function database. Never done that before though - is it just the MATLAB Central "File Exchange"?

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

カテゴリ

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