Undocumented changes in interpn from Matlab 2012a to 2012b
이전 댓글 표시
Hi, the following code results in completely different interpolation results depending on if you use Matlab 2012a or Matlab 2012b versions. There is no documented changes for this function...
apod_matrices = interpn(t, ch_in_az, ch_in_el, apod_matrix, t, ch_out_az, ch_out_el, 'linear', 0);
I have stored the data file to load to run this code on my FTP: folk.ntnu.no/denarie/v2012a.mat
You can easily test the difference using:
load('v2012a.mat');
apod_matrices = interpn(t, ch_in_az, ch_in_el, apod_matrix, t, ch_out_az, ch_out_el, 'linear', 0);
sum(isnan(apod_matrices(:)))
the result is "0" in 2012a and "5940" in Matlab 2012b.
Could you please explain what is happening?
(I am using Windows 7 - 64 bit)
댓글 수: 2
Andreas Goser
2013년 1월 25일
You have both release installed on the same machine and both MATLABs are 64 bit installations? I am asking because you also can install 32 bit MATLAB on a 64 bit machine.
Bastien
2013년 1월 25일
채택된 답변
추가 답변 (1개)
Chrysanthos Placotas
2013년 1월 28일
1 개 추천
This is indeed a bug in R2012b, which produces different results compared to R2012a. It is planned to be resolved in future releases.
댓글 수: 2
Chrysanthos Placotas
2013년 1월 31일
The workaround for this issue, is to convert the query matrices to column vectors, and then resize the output matrix.
apod_matrices2 = interpn(t, ch_in_az, ch_in_el, apod_matrix, t(:), ch_out_az(:), ch_out_el(:), 'linear', 0);
reshape(apod_matrices2,size(ch_out_az));
sum(isnan(apod_matrices2(:)))
Krish
2013년 2월 6일
Is the error I get with the following in 2012b related?
a1 = [1 2 3] ; a2 = [4 5 6 7] ; a3 = [8 9 10 11 12] ;
vv = zeros(length(a1), length(a2), length(a3)) ;
x1 = [1.5] ; y1 = [4.5] ; z1 = [8.5 9.5 10.5 11.5] ;
% Next line works in 2010b, but not in 2012b.
yy = interpn(a1, a2, a3, vv, x1, y1, z1) ;
% Next line works in 2010b and 2012b.
[x11,y11,z11] = ndgrid(x1,y1,z1) ;
yy2 = interpn(a1, a2, a3, vv, x11, y11, z11) ;
diff1 = squeeze(yy2 - yy)
카테고리
도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!