find index of points in meshgrid under the line

조회 수: 5 (최근 30일)
Abhishek Saini
Abhishek Saini 2019년 4월 23일
댓글: KSSV 2019년 4월 23일
I have 2D mesh grid of 501*2001. I want to get indices of values for the grid points in straight line to change the values of grid amplitude as shown in figure. Capture.JPG

답변 (1개)

KSSV
KSSV 2019년 4월 23일
Read about knnsearch. You will get the the required/ nearest indices for the given line from the grid.
  댓글 수: 4
Abhishek Saini
Abhishek Saini 2019년 4월 23일
Let me rephrase my question. I think i was not clear in my question.
I have 2D meshgrid of size 501x2001. Now what I would like to do is to change the value of grid in a linear form in a straight line manner. So that If I use imagesc it will show two different values.
I know the cordinates of line where I have to change the values but I want to get the values in between the two end cordinates to get all the index.
KSSV
KSSV 2019년 4월 23일
I got your question......the answer works.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by