generate grid and coordinates in a rectangle

73 visualizaciones (últimos 30 días)
Davide Cerra
Davide Cerra el 25 de Jun. de 2019
Comentada: KSSV el 25 de Jun. de 2019
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 comentarios
Himanshu Rai
Himanshu Rai el 25 de Jun. de 2019
Can you illustrate with an example, what exactly do you want ?
Davide Cerra
Davide Cerra el 25 de Jun. de 2019
given the two sides i want to generate a grid and extract the coordinates of each internal point.Untitled.jpg

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 25 de Jun. de 2019
Editada: KSSV el 25 de Jun. de 2019
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 comentarios
Davide Cerra
Davide Cerra el 25 de Jun. de 2019
how can i get the coordinates of the internal points?
KSSV
KSSV el 25 de Jun. de 2019
X,Y after meshgrid has all the points.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by