Error in interp1 (line 186) F = griddedInt​erpolant(X​,V,method)​;

조회 수: 2 (최근 30일)
nado
nado 2023년 3월 6일
댓글: nado 2023년 3월 6일
Hello everyone,
I am using interp1 function, in MATLAB R2015a, to interpolate lift and drag coefficients. These coefficients are given in function of the angle of attack.
The angle of attack in the original excel file are sorted in ascending order. However, i am getting the following error:
Error using griddedInterpolant
The grid vectors are not strictly monotonic increasing.
Error in interp1 (line 186)
F = griddedInterpolant(X,V,method);
Please could anyone explain to me where the problem although the angles of attack are sorted and how to fix it?
Best Regards

채택된 답변

Steven Lord
Steven Lord 2023년 3월 6일
although the angles of attack are sorted
Have you confirmed that this is true or are you just assuming that this is true? Call issorted on the first input to interp1 and confirm that this is true.
My guess is that at some point the angle data crosses from say 359 degrees to 1 degree (or the equivalent in radians.) In that case the unwrap function may be of use to you.
  댓글 수: 1
nado
nado 2023년 3월 6일
Thank you for your reply !!!
you were right !!! In fact, the original data file was containing some errors. In general, the lift and drag coefficients are given for angles of attack varying between -180 and 180 degree.
However, in the Excel file, they forgot the minus sign. That's why MATLAB was lost and gave errors.
Best Regards

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by