필터 지우기
필터 지우기

How can i interpolat my data

조회 수: 2 (최근 30일)
b.m.n n
b.m.n n 2017년 1월 17일
댓글: Star Strider 2017년 1월 21일
Could anyone help me ,How can i interpolat my data Q1(37*1),Q2(38*1),depth(0:5:25)
I Created a new depthe D ,and when i use this code >>
X = interp1 (D, Q2, depth, 'linear');
y = interp1 (D, Q1, depth, 'linear');
showing this error
Error using griddedInterpolant The grid vectors do not define a grid of points that match the given values. Error in interp1 (line 183) F = griddedInterpolant(X,V,method); thank you ....

답변 (1개)

Star Strider
Star Strider 2017년 1월 17일
Your ‘D’, ‘Q1’ and ‘Q2’ vectors have to be the same length. You have to decide how to equalize them.
It is probably easier to create ‘D’ as (37x1) and remove one point (probably Q2(end)) from ‘Q2’.
If ‘depth’ uses values outside the range of ‘D’, remember to specify a method (for example 'linear') and use the 'extrap' option.
  댓글 수: 4
b.m.n n
b.m.n n 2017년 1월 21일
Thanks for your advice
Star Strider
Star Strider 2017년 1월 21일
My pleasure.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by