How can I make this simple image on matlab?

조회 수: 1 (최근 30일)
Love Matlab
Love Matlab 2020년 6월 10일
댓글: Love Matlab 2020년 6월 10일
I need to be able to recreate this image attached on matlab. Is this possible? Thank you

답변 (1개)

KSSV
KSSV 2020년 6월 10일
편집: KSSV 2020년 6월 10일
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
Love Matlab
Love Matlab 2020년 6월 10일
Thank you! Is it possible to make all the diagonal lines solid? This is the image I get with your code

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by