How can I make this simple image on matlab?
Show older comments
I need to be able to recreate this image attached on matlab. Is this possible? Thank you

Answers (1)
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 Comment
Love Matlab
on 10 Jun 2020
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!