필터 지우기
필터 지우기

How to interpolate pressure

조회 수: 8 (최근 30일)
주희 박
주희 박 2022년 5월 19일
댓글: Jan 2022년 6월 8일
I have Pressure data (Attached file)
and I want to interpolate pressure by 1m, from 5m to 700m.
How can I make the code?
I know interp1, but i can't make the code properly
  댓글 수: 1
Jan
Jan 2022년 6월 8일
You have asked for a line fitting the data, but removed the question during I've posted an answer:
L = linspace(5, 700, length(P));
poly = polyfit(L, P, 1);
PP = polyval(poly, L);
plot(L, P, '.r', L, PP, 'b');

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

채택된 답변

KSSV
KSSV 2022년 5월 19일
load('matlab_Pressure.mat')
L = linspace(5,700,length(PP)) ;
Li = min(L):max(L) ;
PPi = interp1(L,PP,Li) ;
plot(L,PP,'.r',Li,PPi,'b')

추가 답변 (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