| 198 | = Accessing to the Data portal using Matlab = #ex.matlab |
| 199 | |
| 200 | {{{#!text/matlab |
| 201 | >> ver |
| 202 | ------------------------------------------------------------------------------------- |
| 203 | MATLAB Version 7.8.0.347 (R2009a) |
| 204 | MATLAB License Number: 161051 |
| 205 | Operating System: Microsoft Windows Vista Version 6.1 (Build 7601: Service Pack 1) |
| 206 | Java VM Version: Java 1.6.0_04-b12 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode |
| 207 | ------------------------------------------------------------------------------------- |
| 208 | >> javaaddpath('ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.3/netcdfAll-4.3.jar'); |
| 209 | }}} |
| 210 | |
| 211 | {{{#!text/matlab |
| 212 | >> import ucar.nc2.util.net.* %this will download the netcdfAll-4.3.jar |
| 213 | >> HTTPSession.setGlobalCredentialsProvider(HTTPBasicProvider('username','password')); |
| 214 | >> import ucar.nc2.*; |
| 215 | >> ncfile = NetcdfFile.open('http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml'); |
| 216 | >> v = ncfile.findVariable('Minimum_temperature_at_2_metres_since_last_24_hours_surface'); |
| 217 | >> v.getShape() |
| 218 | >> data = v.read('0,11:359:12,31:61,66,475').copyToNDJavaArray(); |
| 219 | >> sqeeze(mean(data,3)) |
| 220 | }}} |
| 221 | |