interp1 插值 The values of X should be distinct

oyliguang2022-10-04 11:39:541条回答

interp1 插值 The values of X should be distinct
xi=imread('20_0030.tif');%来自未知图片
xi=double(xi);
xi=CalBase1./xi; %这里所得的xi为1024*1280矩阵
for i=1:1024
for j=1:1280
x=[i01(i,j),i02(i,j),i03(i,j),i04(i,j),i05(i,j),i06(i,j),i07(i,j),i08(i,j),i09(i,j)]; %这里i01~019为1024*1280矩阵,是已知的
y=[1,4,14,24,42.5,59.8,68.3,80,91.8];
yi=interp1(x,y,xi(i,j),'linear'); %希望求得1024*1280的yi
end
end
但是出错了,不太明白
Error using ==> interp1 at 262
The values of X should be distinct.

已提交,审核后显示!提交回复

共1条回复
uu甲车 共回答了21个问题 | 采纳率76.2%
interp1要求你的x必须是唯一,即x里面的元素只能出现一次.

x=[1,2,3];
y=[4,5,6];
y1=interp1(x,y,2.5) %这个没有问题
x=[1,2,2]; %2重复
y=[4,5,6];
y2=interp1(x,y,2.5) %这个有问题,因为2重复
你检查你的i01~i09里面有没有相同的元素出现.
1年前

相关推荐

the precious meaning of the word is open to different interp
the precious meaning of the word is open to different interpretation
is 和 open 之前是不是应该有to 而被省略掉了 什么出处啊
cufe19491年前1
1W英尺的天边 共回答了7个问题 | 采纳率85.7%
这里open是adj.
不需要to