Once, again, I'm messed up using Matlab and mexcnc Using Matlab2009a, on PC with the netcdf toolbox from sourceforge (from Sept. 09) that we put these under m_contrib/trunk/mexcdf_2008b_plus, then put these elements in the path after the $MATLABroot entries. /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/mexnc /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/snctools /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/netcdf_toolbox/netcdf /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/netcdf_toolbox/netcdf/nctype /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/netcdf_toolbox/netcdf/ncutility which mexnc /home/ellyn/mtl/m_contrib/trunk/mexcdf_2008b_plus/mexnc/mexnc.m If I run the code from adv2nc (lines 458-461: where cdfb{'vel?'} are assigned to Adv.V?) I end up with (Adv.Vx{1}) as 1 x 120. The call to xyz2enum that deals with Adv.Vx, Adv.Vy and Adv.Vy expects 120x1 (the shape that used to get created), John Evans suggested : Try going into mexnc/private/mexnc_tmw.m, and commenting out lines 1739-1741. They should read something like if (ndims(data) == 2) && (size(data,2) == 1) data = data'; end Commenting this out lets xyz2enu() work as it should but breaks ecorr(). In xyz2enu, you've passed in x, y, z of one 120 point burst. vs, vy and vz should each should be 120x1, so nprof=120, and you get nburst=1. At the end, the loop where the matrix multiply of rot2enu, occurs should be done on each point, so first=1, last=120. This is not a one shot where the entire burst is done at once. Xyz2enu will run, even if the matrix is supplied in the "wrong" orientation, but the return matrices will all be nan, and then failure occurs in line 606 where gmin is done on Adv.Vu{1}. Gmin and gmax should work with all nan's, but sometimes it doesn't- usually because the gmin in the private directory for that code isn't updated. The problem in ecorr is that lpfilt as called needs the opposite shape as what xyz2enu wants. I added a condition to transpose the matrix if it shows up the "wrong" way. FYI a 3x1 vector is a 3 element column, a 1x3 vector is a 3 element row.