필터 지우기
필터 지우기

netcdf function is not working and the program keep showing this message

조회 수: 4 (최근 30일)
netcdf function is not working and the program keep showing this message ??? Undefined function or method 'netcdf' for input arguments of type 'char'.
  댓글 수: 7
hossam mohamed
hossam mohamed 2015년 1월 11일
the command that i am using is (netcdf(file_name);)
hossam mohamed
hossam mohamed 2015년 1월 11일
even the command (ncdisp(file_name);) is not working and it is showing this message (??? Undefined function or method 'ncdisp' for input arguments of type 'char'.)

댓글을 달려면 로그인하십시오.

채택된 답변

Mohammad Abouali
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
hossam mohamed
hossam mohamed 2015년 1월 14일
After writing these function, how can i show the real data of the netcdf file in matlab
Mohammad Abouali
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 CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by