Find values within a contour and replace with nan

Hi,
I have a contour (bathymetry) line with a column of values x, y. I also have a dataset of chlorophyll values (XX,YY,Chl) scattered on the map. I would like find all the Chl values within the contour and replace with NaN. Is it also possible to choose a distance, say 3 km, outside the contour line and replace all those values with NaN?

답변 (1개)

Adam Danz
Adam Danz 2020년 12월 30일

0 개 추천

It sounds like the goal is to hide the scatter points under the contour in which case it would be easiest to use the (x,y) coordinates that define the contour to create a white patch that's plotted on top of the existing objects.

댓글 수: 3

akk
akk 2020년 12월 30일
I would like to average all the values after removing those inside the contour. I have tried using inpolygon, but for some reason there are still a few points left inside the contour.
Can you upload data and code to reproduce your diagram? Make it easy for us to help you.
Adam Danz
Adam Danz 2020년 12월 30일
편집: Adam Danz 2020년 12월 30일
In that case I would recommend inpolygon as you have discovered. If you want to remove all points within the larger contour, you should only use the (x,y) coordinates that define the outer contour and remove the coordinates that define the inner contours.
If you want to remove all points within the larger contour that are not within the inner contours, follow this example,
If you're having further problems, provide more detail.

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

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

질문:

akk
2020년 12월 30일

편집:

2020년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by