Is there a bug in the INTERP2 function within MATLAB 6.5 (R13) when using the "*" methods?
Mostrar comentarios más antiguos
The documentation states that for "ZI = interp2(X,Y,Z,XI,YI, method) ", "you can pass in the row and column vectors XI and XI, respectively. In this case, interp2 interprets these vectors as if you issued the command meshgrid(XI,YI)." However, this is not the case when the method is prepending with an "*". To view an example of this, generate the following data:
load census
[xg yg]=meshgrid(cdate,pop);
xi = 1800:20:2000; yi = [1:30]';
zg = rand(21,21);
Then, the following command executes correctly as stated in the documentation:
interp2(xg,yg,zg,xi,yi,'nearest')
However, when the method is changed to "*nearest"
interp2(xg,yg,zg,xi,yi,'*nearest')
I receive an error message.
??? Error using ==> interp2 (nearest)
XI and YI must be the same size.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Eigenvalue Problems en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!