How to create matrix 10x10 with same diagonal vector and empry value

조회 수: 5 (최근 30일)
Ira Wal
Ira Wal 2020년 11월 28일
댓글: Ira Wal 2020년 12월 7일
I am new to matlab and i need to create a 10x10 matrix, which consists of same number by diagonal, triangular matrix and empty values (like on image)

채택된 답변

Stephen23
Stephen23 2020년 11월 28일
M = toeplitz([2,1,zeros(1,8)])
M = 10×10
2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by