interp2 Error The grid vectors are not strictly monotonic increasing.

조회 수: 1 (최근 30일)
I am looking for some help where i can first understand why some of my data works with this script and some does not. And second i need to figure out how to fix the data that does not work.
In my script i am trying to generate a 2D image that has the proper time variable on the left side. My instrument creates a materix that is made by time slice and not a linear time scale. The interp2 function can correct this and create the images that i need.
The error that i am getting in matlab is that The grid vectors are not strictly monotonic increasing. This error means that the program is unable to compute the proper point where new points go because the squares on the grid are not constant. I dont know how to fix this so any help would be appreciated.

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 16일
>> find(diff(y)==0)
ans =
520 522 524 526 528 710 712 714 716 718 720 722 724 726 728
You have some duplicate y. The first of these, location 520, occurs where y goes from being a two-digit positive number to being a 3-digit positive number. Before that locations you have points that are as close together as 0.02 apart, and in the area just before location 520 the points are about 0.5 apart . But your representation of y is in scientific notation with exactly 3 digits besides the sign and exponent. Unless the points just happen to get further apart just as y goes to 100, you do not have sufficient precision in your representation of y and so y that were originally distinct are getting rounded to be the same integer in your file representation of them.
You need to go back and recreate your csv using more significant digits in your representation of y.
  댓글 수: 1
Max Livshits
Max Livshits 2015년 8월 17일
Tank You for your response and simplified explication Walter. I have adjusted the number of sig figs and everything works just fine.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by