If you wish to read netCDF data from an OPeNDAP server, you need only to follow these steps:
javaaddpath('/home/jevans/matlab/classes/netcdfAll-4.0.jar','-end');
setpref('SNCTOOLS','USE_JAVA',true);
SNCTOOLS programs such as NC_VARGET and NC_DUMP will now switch to using its java backend to read OPeNDAP data. MATLAB's native netCDF package will still be used to read local data.
It is also possible (but not all that easy) to compile the old mexnc mex-file source with the opendap libraries instead of the genuine Unidata netcdf libraries. This makes it possible to access remote opendap datasets as if they were local, and any MATLAB code that you have that used the mexnc interface directly should just work with it. But building opendap-enabled mexnc mex-files is a fairly difficult process, and even more difficult is running it on another machine. If any libraries differ at all on said other machine, the mex-file will usually not work. For that reason, it's better to build opendap-enabled mex-files yourself rather than trying ones that someone else built. And it may be easier just to use SNCTOOLS with the java backend anyway.
Here are some notes I've made that either got mexnc to work with opendap, or failed miserably.
Windows seems to be the only platform that is an exception to the problem of running the mex-file on a separate machine, so windows mex-files are provided below.
R2006a Windows : Build on WinXP, April 24, 2006. Contributed by Rich Signell.
R14 Windows : Built on Opendap 3.4.4, WinXP, June 1, 2006. Contributed by Rich Signell.
R11 Windows: Built on Opendap 3.4.4, WinXP (SP2), September 13, 2005. Contributed by Rich Signell.