How to resolve this error message in interpolate1?

조회 수: 2 (최근 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 CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by