How to resolve this error message in interpolate1?

1 回表示 (過去 30 日間)
Ismail Qeshta
Ismail Qeshta 2018 年 5 月 27 日
コメント済み: Ismail Qeshta 2018 年 5 月 27 日
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 件のコメント
dpb
dpb 2018 年 5 月 27 日
Very risky move... :)
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 Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by