필터 지우기
필터 지우기

Can I use interpolation to small scale?

조회 수: 8 (최근 30일)
승현 이
승현 이 2022년 12월 5일
댓글: 승현 이 2022년 12월 5일
I usually use interp1 function to stratch data.
But now, i want shortening data and I'cant use interp1.
Results.Volume(:,1)= interp1(1:length(VOL),VOL,1:7200)';
=>length(VOL) = 8003
help me please!

채택된 답변

Askic V
Askic V 2022년 12월 5일
편집: Askic V 2022년 12월 5일
Not really sure if I understood your question, but if you want less data points within the same interval, then just use interp1. Here is one example:
close all
x = linspace(0, 10, 100); % 100 points between 0 and 10
y = sin(x * 2);
plot(x,y)
hold on
% 2 times smaller in size
xi = linspace (0,10,50); % 50 points between 0 and 10
yi = interp1(x, y, xi, 'linear');
plot(xi,yi,'r')
  댓글 수: 2
승현 이
승현 이 2022년 12월 5일
이동: Bruno Luong 2022년 12월 5일
I applogize my English!
I'd like to change the Y values for X of 1:8003 to the new Y2 for X2 of 1:7200.
If it works well,
plot(X2,Y2) will be overlapping plot(X,Y)
Thank you
승현 이
승현 이 2022년 12월 5일
I solved problem using resample function.
Thank you for kind answer

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by