title: Downloading GRIB files directly into Matlab
body: <p>I want to read in data from the GFS weather forecasting model. The NOAA has some URL links from which the data can be downloaded, e.g.:</p>
  
  <p><a href="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t06z.pgrb2.0p25.f005&amp;lev_surface=on&amp;var_CAPE=on&amp;leftlon=0&amp;rightlon=360&amp;toplat=90&amp;bottomlat=-90&amp;dir=%2Fgfs.2019053006" rel="nofollow noreferrer">https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t06z.pgrb2.0p25.f005&amp;lev_surface=on&amp;var_CAPE=on&amp;leftlon=0&amp;rightlon=360&amp;toplat=90&amp;bottomlat=-90&amp;dir=%2Fgfs.2019053006</a></p>
  
  <p>In the internet browser, this link automatically downloads a file (but which format?). In Matlab I do the following:</p>
  
  <pre class="lang-matlab prettyprint-override"><code>fullURL = ['https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t06z.pgrb2.0p25.f011&amp;lev_surface=on&amp;var_CAPE=on&amp;leftlon=0&amp;rightlon=360&amp;toplat=90&amp;bottomlat=-90&amp;dir=%2Fgfs.2019053006'];
  
  filename = 'cape_test.anl';
  
  urlwrite(fullURL,filename);
  </code></pre>
  
  <p>These files open well in GIS software such as QGIS or ArcGIS. But how can I now read in these files automatically in MatLab so I can display them with the <code>imagesc()</code> command? Trying NCToolbox didn't work.</p>