netcdf function is not working and the program keep showing this message
4 ビュー (過去 30 日間)
古いコメントを表示
hossam mohamed
2015 年 1 月 9 日
コメント済み: Mohammad Abouali
2015 年 1 月 15 日
netcdf function is not working and the program keep showing this message ??? Undefined function or method 'netcdf' for input arguments of type 'char'.
7 件のコメント
採用された回答
Mohammad Abouali
2015 年 1 月 11 日
編集済み: Mohammad Abouali
2015 年 1 月 11 日
Well, you are using the command wrong.
netcdf(file_name) is not a command.
Note that MATLAB version 2010a was only supporting the kinda one-to-one mapping of (C/FORTRAN) NetCDF api. Recent versions of matlab have other commands that are much easier to read and write a netcdf file. for example ncdisp is not supported in MATLAB 2010a. Neither is ncread.
In that older API you can read a file like this:
% Open the NetCDF file
ncid = netcdf.open('example.nc','NC_NOWRITE');
% returning information from the files:
[ndims,nvars,ngatts,unlimdimid] = netcdf.inq(ncid)
% getting information about a variable
%varid is an integer from 1 to nvars (nvars is the output of previous command.
[varname,xtype,dimids,natts] = netcdf.inqVar(ncid,varid)
% Reading the entire variable
data = netcdf.getVar(ncid,varid)
3 件のコメント
Mohammad Abouali
2015 年 1 月 15 日
That's whole another question. The variable data is holding the information. Depending on what type it is, what it is, you can plot it different way.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で NetCDF についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!