RECTANGLE using MESHGRID in MATLAB

2 visualizaciones (últimos 30 días)
Jerome
Jerome el 25 de Mzo. de 2013
I am interested in creating a square/rectangle using meshgrid in MATLAB. Can someone assist me with this?
Thanks in advance

Respuestas (2)

Youssef  Khmou
Youssef Khmou el 25 de Mzo. de 2013
hi, try :
x=0:0.01:1; % 1 meter
y=x; % square then .
[X,Y]=meshgrid(x,y);
Z=X*Y; % square table
figure, surf(Z), shading interp

Image Analyst
Image Analyst el 25 de Mzo. de 2013
Why using meshgrid, rather than just regular assigning by indexes, which is a heck of a lot easier and simpler to understand?
grayImage = 128*ones(240,320, 'uint8');
grayImage(20:50, 120:150) = uint8(200);
imshow(grayImage);
axis on;

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by