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 commentaires

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.
Yes I have both 64 bits releases installed on my machine.

Connectez-vous pour commenter.

 Réponse acceptée

Andreas Goser
Andreas Goser le 25 Jan 2013
There is a reported issue that is currently under investigation. Please contact Technical Support with this issue and refer to "solution 1-K4TSEV"

1 commentaire

Ok, thanks a lot, I have opened a Service request in the Technical Support (ref 1-LB036F).

Connectez-vous pour commenter.

Plus de réponses (1)

Chrysanthos Placotas
Chrysanthos Placotas le 28 Jan 2013
This is indeed a bug in R2012b, which produces different results compared to R2012a. It is planned to be resolved in future releases.

2 commentaires

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(:)))
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)

Connectez-vous pour commenter.

Catégories

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by