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

12 ビュー (過去 30 日間)
Erhan Ferdi
Erhan Ferdi 2014 年 2 月 23 日
コメント済み: Erhan Ferdi 2014 年 2 月 23 日
??? 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 件のコメント
Erhan Ferdi
Erhan Ferdi 2014 年 2 月 23 日
help ?
Erhan Ferdi
Erhan Ferdi 2014 年 2 月 23 日
help???

サインインしてコメントする。

回答 (1 件)

Dishant Arora
Dishant Arora 2014 年 2 月 23 日
編集済み: Dishant Arora 2014 年 2 月 23 日
A should have as many elements as length(x)*length(y) . A specifies values at those grid points.
  1 件のコメント
Dishant Arora
Dishant Arora 2014 年 2 月 23 日
Erhan, you should ask your query here in comment box. for example go throgh the documentation of interp2

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by