Undocumented changes in interpn from Matlab 2012a to 2012b
Mostra commenti meno recenti
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 Commenti
Andreas Goser
il 25 Gen 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
il 25 Gen 2013
Risposta accettata
Più risposte (1)
Chrysanthos Placotas
il 28 Gen 2013
1 voto
This is indeed a bug in R2012b, which produces different results compared to R2012a. It is planned to be resolved in future releases.
2 Commenti
Chrysanthos Placotas
il 31 Gen 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
il 6 Feb 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)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!