generate grid and coordinates in a rectangle

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 个评论

Can you illustrate with an example, what exactly do you want ?
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 个评论

how can i get the coordinates of the internal points?
X,Y after meshgrid has all the points.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by