필터 지우기
필터 지우기

generate grid and coordinates in a rectangle

조회 수: 27 (최근 30일)
Davide Cerra
Davide Cerra 2019년 6월 25일
댓글: KSSV 2019년 6월 25일
i have sides of a rectangle as input and i want to generate a grid that gives as output the coordinates of the internal points.
  댓글 수: 2
Himanshu Rai
Himanshu Rai 2019년 6월 25일
Can you illustrate with an example, what exactly do you want ?
Davide Cerra
Davide Cerra 2019년 6월 25일
given the two sides i want to generate a grid and extract the coordinates of each internal point.Untitled.jpg

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

채택된 답변

KSSV
KSSV 2019년 6월 25일
편집: KSSV 2019년 6월 25일
Read about meshgrid. Let L and B be the length and breadth of the rectangle.
L = 2. ;
B = 1. ;
m = 100; n = 100 ;
l = linspace(0,L,m) ;
b = linspace(0,B,n) ;
[X,Y] = meshgrid(l,b) ;
mesh(X,Y)
view(2)
If you have the data points for the opposite sides or for the four side, read about transfinite interpolation.
  댓글 수: 2
Davide Cerra
Davide Cerra 2019년 6월 25일
how can i get the coordinates of the internal points?
KSSV
KSSV 2019년 6월 25일
X,Y after meshgrid has all the points.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by