I getting an error (interp2 size). Can you help me ??

4 visualizaciones (últimos 30 días)
Erhan Ferdi
Erhan Ferdi el 23 de Feb. de 2014
Comentada: Erhan Ferdi el 23 de Feb. de 2014
??? Error using ==> interp2 at 147 The lengths of X and Y must match the size of Z.
??? Error in ==> Untitled55 at 12 mesh (xi,yi,interp2 (x,y,A,xi,yi, 'linear'));
% Code here:
clc;
clear all
clf;
colormap ('JET');
A = [-10,5,10;0.2,1,2;1,6,2];%%%%
% I am sure, this error is here...I did not understand. How can I do?
x = (-10:.5:10);
y = [0.98391 0.99116 0.99551 1.00565 0.99406 0.97377 0.99406 0.98391 0.98681 0.96797....
0.95348 0.92884 0.89986 0.90565 0.93174 0.96652 1.02304 1.08681 1.14188 1.13029....
1.1042 1.09986 1.09261 1.07087 1.06942 1.05928 1.06507 1.06797 1.05203 1.05493....
1.05348 1.07522 1.06217 1.07667 1.05203 1.05058 1.05638 1.06797 1.04333];
xi = linspace (min (x), max (x), 39);
yi = linspace (min (y), max (y), 5);
mesh (xi,yi,interp2 (x,y,A,xi,yi, 'linear'));
[x,y] = meshgrid (x,y);
hold on; plot3 (x(:),y(:),A(:),'b*'); hold off;
  3 comentarios
Erhan Ferdi
Erhan Ferdi el 23 de Feb. de 2014
help ?
Erhan Ferdi
Erhan Ferdi el 23 de Feb. de 2014
help???

Iniciar sesión para comentar.

Respuestas (1)

Dishant Arora
Dishant Arora el 23 de Feb. de 2014
Editada: Dishant Arora el 23 de Feb. de 2014
A should have as many elements as length(x)*length(y) . A specifies values at those grid points.
  1 comentario
Dishant Arora
Dishant Arora el 23 de Feb. de 2014
Erhan, you should ask your query here in comment box. for example go throgh the documentation of interp2

Iniciar sesión para comentar.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by