MATLAB - Read GRIB Data

10 次查看(过去 30 天)
Background:
I want to import meteorological data (wind speed, temperature as a function of position and altitude) in the GRIB-format into Matlab.
Status:
While googling I found this Matlab-Grib-Reader: http://www.mathworks.com/matlabcentr...exchange/21579
The Matlab Grib-Reader requires CDI libraries from here: https://code.zmaw.de/projects/cdi/files
The libraries must be compiled with the own machine, i used this terminal commands:
./configure CFLAGS=-fPIC CPPFLAGS=-fPIC --enable-shared
make
I copied the resulting libcdi.a library into the lib64 folder, and executed compile.m which gave me the following:
COMPILING cdi_varlist...
cdi_mx.c: In function 'getLevel':
cdi_mx.c:431: warning: incompatible implicit declaration of built-in function 'modf'
Undefined symbols for architecture x86_64:
"_Warning", referenced from:
_getLevel in cdi_mx.o
(maybe you meant: _Warning_)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
mex: link of ' "cdi_varlist.mexmaci64"' failed.
Error using mex (line 206)
Unable to complete successfully.
Error in compile (line 15)
mex cdi_varlist.c cdi_mx.c -Iinclude -Llib64 -lcdi -lnetcdf
Who can help?
PS: Matlab 2012a, Mac OS X 10.8.2, Xcode 4.6

采纳的回答

Jacob Halbrooks
Jacob Halbrooks 2024-9-25
As of R2023b, you can read data from a GRIB file (.grb, .grib, .grib2) using the Mapping Toolbox readgeoraster function. You can also get information about a GRIB file by using the georasterinfo function. These functions were enhanced in R2024b to support GRIB files that use CCSDS compression.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by