Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

(R2010a) INTERP3 vertcat error, CAT arguments dimensions are not consistent.

조회 수: 1 (최근 30일)
Adam
Adam 2014년 5월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi all, when I was trying to use CONEPLOT function I got this error in an inner INTERP3 function:
??? Error using ==> vertcat CAT arguments dimensions are not consistent.
Error in ==> interp3 at 204
[~,i] = sort([zz;zzi]);
Error in ==> slice at 104
vi = interp3(x,y,z,v,xi,yi,zi,method);
The strange thing was that it worked for some specific combination of CONEPLOT input arguments, so this error showed up only for certain sizes of input arguments.
I tried to trace the problem and seems to solved it by "repairing" following line in a INTERP3 code.
INTERP3.m > original line 149:
xx = x(1,:,1).'; yy = y(:,1,1); zz = squeeze(z(1,1,:)); % columns
It seems that in this case the SQUEEZE function returns a row vector (1xN) zz while xx and yy are column vectors (Nx1), which cause this error in above-mentioned line 204.
Don't know if the main problem is somewhere else, I "repair" it by adding .' after SQUEEZE function
zz = squeeze(z(1,1,:)).';
As I mentioned in the title, I'm using MATLAB R2010a, I didn't test it for any other versions. However, it is possible that this "correction" cause more problems than benefits :-)
Have someone been faced with this problem? Could you test it?
Hope it helps...
Thanks, Adam
PS: I use the CONEPLOT function according to the example described in the Help (coneplot). The problem has happened for certain combination of input matrix sizes...
  댓글 수: 3
Adam
Adam 2014년 5월 27일
Hi Mahdi, for
coneplot(Xi,Yi,Zi,u,v,w,cx,cy,cz)
where
Xi,Yi,Zi,u,v,w ... (17x17x17)
cx,cy,cz ... (10x10x10)
therefore, line 143 (in coneplot.m)
interp3(x,y,z,u,cx,cy,cz,method);
where
x,y,z ... (17x17x17)
cx,cy,cz ... (1000x1)
works perfectly. If I change the (17x17x17) matrices to e.g. (19x19x19) then it is not working and error will show up.
I trace the INTERP3 code and it goes different way for these two sizes of input matrices.
Problematic is the line 204 (interp3.m) for the latter case. The former one (17x17x17) do not pass this line.
Thanks, Adam.
Adam
Adam 2014년 5월 27일
Looks like that line 154 (in interp3.m) decides to pass the part of the code starting at line 176 (Bypass mapping code for cubic). It passes this part for 19x19x19 (in my alghoritm) resulting in the error, but it skips this part in case of 17x17x17 matrices.
So the line 154 decides based on the actual value of data... Not sure if it works correctly for regular grid and linear interpolating.

답변 (0개)

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by