How can I make this simple image on matlab?

1 visualización (últimos 30 días)
Love Matlab
Love Matlab el 10 de Jun. de 2020
Comentada: Love Matlab el 10 de Jun. de 2020
I need to be able to recreate this image attached on matlab. Is this possible? Thank you

Respuestas (1)

KSSV
KSSV el 10 de Jun. de 2020
Editada: KSSV el 10 de Jun. de 2020
m = 50 ;
A = zeros(m) ;
N = 10 ;
for i = N:N:m
n = m-i ;
t = ones(1,n) ;
A = A+diag(t,-i) ;
end
for i = N:N:m
n = m-i ;
t = ones(1,n) ;
A = A+diag(t,i) ;
end
A = A+diag(ones(1,m)) ;
A = A+fliplr(A) ;
pcolor(A)
shading interp
  1 comentario
Love Matlab
Love Matlab el 10 de Jun. de 2020
Thank you! Is it possible to make all the diagonal lines solid? This is the image I get with your code

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by