The Short And Sweet Of It... =========================================================================== Add this directory to your MATLAB path, and you are now setup to use mexnc. Check the READMEs for SNCTOOLS for further instructions. Please note that mexnc is NOT the same as the "NetCDF Toolbox", which is something that I did not write and therefore cannot support. Some Efficiency Considerations =========================================================================== Mexnc can currently use two different backends for accessing your netcdf data, the old mexnc mex-file, and the new MATLAB netcdf package. Choosing between them may be determined by as simple a factor as what version of MATLAB you have, or by more complex criterion such as access to password-protected opendap datasets. If you have 2008a or earlier and if your code calls mexnc, then you must use the mexnc mex-file that should be present in the mexnc/private directory. If you have 2008b or later, you should tell mexnc use MathWork's native netcdf package. You can do this via a preference, i.e. >> setpref('MEXNC','USE_TMW',true); The only reason it might ever make sense to set this preference to false would be if you have 2009a, 2009b, or 2010a and you need to write netcdf-4 files with mexnc (or you can upgrade to 2010b). And please note that 2006a through 2010a can read netcdf-4 files just fine via SNCTOOLS with the java backend enabled. In order to use a netcdf4-enabled mex-file, though, you will need to compile it yourself. Check the mexopts files in the src directory to get an idea of how to do that. So mexnc is pretty flexible about things, but all this flexibility comes at a cost of performance. If If you know for certain that you want to ONLY one backend or the other, then you may wish to examine the source code for mexnc.m starting at line 546. Therein lies an explanation of a way to speed up the execution of mexnc IF YOU KNOW EXACTLY WHAT YOU ARE DOING. Again, I'll let you be the judge of that. R2008a and Earlier =========================================================================== Mexnc is only supported on versions R14 and later. R13 will not pass all of the mexnc test suite, but that is due more to the way the test suite is written than the code itself. If you want to use mexnc on R13 or below, you are welcome to do so, but you are on your own. If you have MATLAB versions R2008a or earlier, then you need to realize that you still need the mex-file "mexnc". This is not included in this download. You need to either retrieve it from another download at sourceforge or compile it yourself (the source code IS still included). You can find the source code in the src subdirectory. If you are using windows, then you also need to place the netcdf.dll file somewhere on your SYSTEM path (not your matlab path, but your system path). Something like either [matlabroot '/bin'] or [matlabroot '/bin/win32'] would be good choices. You might have to reboot. SUPPORT =========================================================================== Please note, mexnc is NOT supported by The MathWorks, so please do not ask them questions about it. If you encounter problems with mexnc, you should continue to use the same contact email address that is listed on the sourceforge web site. OPeNDAP =========================================================================== I recommend that you use SNCTOOLS with the java backend if you need OPeNDAP access. It's a lot easier than what follows below. If you really wish to use an opendap-enabled version of mexnc, then you have to compile your mex-file yourself. You can also look at the various mexopts files in the src directory to try to get a sense out of what you need to grok in order to get this done. Depending upon which release you have, you should try something like the following. Suppose you have R2008a. In order to compile an opendap- enabled mex-file, you would have to invoke make R2008a If you have R2008b and higher and you want to use the native matlab functionality along with opendap, then you should first look at how SNCTOOLS manages this. It can use a java backend for all URLs while using the native netcdf package for local I/O. If you do not wish to use SNCTOOLS, then you need to do a careful two-step dance with a preference. When you are doing your opendap work, set this preference >> setpref('MEXNC','USE_TMW',false); This will cause ALL I/O to go thru the opendap-enabled mex-file (that you have to compile), so remember to turn the preference back on when you are done with it. Problems? =========================================================================== I don't have a lot of time for mexnc anymore, but you can still email me at johne.g.evans.ne@gmail.com