MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB数学相关] 请教关于二维插值interp2的问题 (https://www.labfans.com/bbs/showthread.php?t=12174)

76587658 2010-10-17 15:32

请教关于二维插值interp2的问题
 
老师让用二维插值函数做一问题,但interp2函数总是出错,请高手指点
程序如下
x=[77,81,88,103.5,105.5,107.5,117.5,129,140,157.5,162,162,185.5,195];
y=[-81,-66.5,-33.5,-6.5,3,7.5,22.5,23,56.5,84,85.5,137.5,141.5,147];
z=[4,4,6,6,8,8,8,8,8,8,9,9,9,9];
[XI,YI]=meshgrid(-100:.1:200,-100:.1:200);
ZI=interp2(x,y,z,XI,YI);mesh(XI,YI,ZI)
然后matlab提示??? Error using ==> interp2 at 180
X and Y must be monotonic vectors or matrices produced by MESHGRID.

请问如何修改,到底错在哪了,请给出具体该法,谢谢了,都纠结一晚了


所有时间均为北京时间。现在的时间是 03:30

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.