How to resolve this error message in interpolate1?

1 次查看(过去 30 天)
Hi, I am using the following code for interpolation:
clear; clc;
y=load ('xx11.0.txt');
x=load ('yy11.0.txt');
plot(x(:,2),-sum(y(:,2:11),2))
xlabel('X')
ylabel('Y')
y1=-sum(y(:,2:11),2);
x1=x(:,2);
y3=unique(y1);
x3=unique(x1);
y2 = [9080.954]*1000;
x2 = interp1(y3, x3, y2, 'linear');
figure(1)
plot(x1, y1, '-g')
hold on
plot(x2, y2, 'bp')
hold off
grid
legend('Data', 'Interpolated Points', 'Location', 'NW')
But I keep getting the following error message:
Error using interp1>reshapeAndSortXandV (line 423)
X and V must be of the same length.
Error in interp1 (line 92)
[X,V,orig_size_v] = reshapeAndSortXandV(varargin{1},varargin{2});
Error in Interpolate (line 15)
x2 = interp1(y3, x3, y2, 'linear');
  11 个评论
Ismail Qeshta
Ismail Qeshta 2018-5-27
Thanks dpb for your feedback. I am actually aware of it. I just need a rough estimate of the data at this stage. I shall get back to you when I need to be more accurate. Thank you very much again for your great help.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by