I want to do a quiver3 vector plot and streamline. I am doing a test with simple data as defined in the attached file testx.m. If I define my grid with meshgrid, quiver3 gives an incorrect vector field, but streamline works expectedly on the incorrect field. If I define my grid as X(i,j,k)=x(i), etc, quiver3 works correctly but streamline returns the error below. Would appreciate some help. This may have something to do with the way grids are defined but, as it stands, it seems internally inconsistent between quiver3 and streamline.
>> h=streamline(X,Y,Z,Bx,By,Bz,0.8,0,2) ??? Error using ==> interp1 at 261 The values of X should be distinct.
Error in ==> stream3 at 67 sxi=interp1(xx(:),1:szu(2),sx(k));
Error in ==> streamline at 69 verts = stream3(x,y,z,u,v,w,sx,sy,sz,options);