As of April 2013, this version of the documentation is no longer maintained; however, it is consistent with the last (now retired) version of CODAS processing that used Matlab. We no longer update or fix the Matlab processing code, but we will maintain the Matlab code that reads CODAS Matlab output. Although the notes refer to both Python and Matlab processing, none of the code here will be maintained. This (now retired) documentation and code will remain available for awhile longer.
Python processing code is actively maintained and developed, and CODAS Python processing is documented here.
We use a mex file (“C” code compiled for Matlab) for interpolation. In older versions of Matlab, linear interpolation was done by “table1.m”. It was quite slow, so we wrote a version in “C” that was much faster. Table1 has been deprecated for some time, and in newer versions of Matlab it will no longer run. The current matlab replacement is “interp1.m”, but it is still slower than our mex file.
The “C” code is called “table1_core.c” and the mex file is called by “table1.m”. Several versions of table1_core exist in the matlab directory, in directories called mex6* or mex7*.
In Matlab, type:
% add codas matlab programs to your path adcppath % find out which version you are using which table1_core % test it x = table1([1 2; 3 4], 2) % comment: this should return a value of 3
- The file “mexpath” will try to add an appropriate mex directory.
- Test (above) to see if you can run “table1” as is. If so, you’re done.
- If the test fails, read “mexpath.m” to see which versions are present.
- Choose a mex directory corresponding to a matlab version older than your own.
- change directories into that mex directory, and test again (the directory ”.” or “current working directory” should already be on your path).
- Test again.
- If you find a version that runs, copy the appropriate mex files to the “mexsrc” directory – it is the last thing “maxpath.m” will try, so in this scenario, “mexsrc” should be on your path.
- Kill matlab, start again, type “adcppath” and test table1.
You must have a gcc compiler on your path
in matlab, change directories to “mexsrc” and runmex table1_core.c %% these are used in our contouring routines mex arc.c mex polymx.c mex zgridmx.c
Kill matlab, start again, type “adcppath” and test table1.