Undocumented changes in interpn from Matlab 2012a to 2012b
Afficher commentaires plus anciens
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
Andreas Goser
le 25 Jan 2013
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
le 25 Jan 2013
Réponse acceptée
Plus de réponses (1)
Chrysanthos Placotas
le 28 Jan 2013
1 vote
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
Chrysanthos Placotas
le 31 Jan 2013
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
le 6 Fév 2013
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)
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!