loaddaps (Net cdf) problem on new computer (Windows 7) and new version (2011b) of Matlab

1 view (last 30 days)
Hello,
I recently switched computers (from XP to Windows 7) and updated from 2009b to 2011b versions of Matlab.
I have old code that runs off the opendap toolbox. It used to run, but it won't anymore. Here is a snippet that should work for anyone that has loaded the OpenDAP functions:
addpath('C:\opendap\loaddap')
Sal=loaddap('http://iridl.ldeo.columbia.edu/expert/SOURCES/.NOAA/.NODC/.WOA09/.Grid-1x1/.Annual/.salinity/.s_an/dods');
The data are salinity data from the World Ocean Atlas 2009. I receive the following error:
??? Error: File: loaddap.m Line: 1 Column: 27
Unbalanced or unexpected parenthesis or bracket.
I have tried to point the ncread function to the same url, but I get the following error:
Sal=ncread('http://iridl.ldeo.columbia.edu/expert/SOURCES/.NOAA/.NODC/.WOA09/.Grid-1x1/.Annual/.salinity/.s_an/dods');
??? Error using ==> nc>nc.openToRead at 1255
Could not open http://iridl.ldeo.columbia.edu/expert/SOURCES/.NOAA/.NODC/.WOA09/.Grid-1x1/.Annual/.salinity/.s_an/dods for
reading
Error in ==> nc>nc.nc at 123
this.openToRead();
Error in ==> ncread at 51
ncObj = internal.matlab.imagesci.nc(ncFile);
I don't know if this is a loaddaps problem, a Matlab problem, a problem with the database, or a problem with my understanding of this code. Can anyone help me with this issue?
Thank you, Brad

Accepted Answer

Walter Roberson
Walter Roberson on 25 Apr 2012
When you upgraded, did you happen to go to 64 bit MATLAB? If you did then you are going to have to rebuild opendap from source, as the provided binaries are for windows 32 bit.
If you were to try to use the 32 bit binary with 64 bit MATLAB then it would not find the .mex* binary because of the architecture difference, and then it would try to execute the .m file as if it was MATLAB source code.
Side note: MATLAB R2012a includes opendap support; see http://www.opendap.org/user/jimg/blog/matlab_2012a
  3 Comments
K E
K E on 4 Aug 2015
Walter: Very, very useful side note that this functionality is now built in to Matlab. I now no longer have to mess around with cygwin, loaddap, etc. You just saved me 1+ days of work.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!