How to interpolate pressure

3 次查看(过去 30 天)
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