How to became my Tridiagonal matrix

조회 수: 9 (최근 30일)
PRED LIU
PRED LIU 2020년 7월 7일
답변: Walter Roberson 2020년 7월 8일
B=[
16, 2 , 3, 13;...
5 , 11, 10, 8;...
9 , 7 , 6, 12;...
4, 14, 15, 1]
How to became my Tridiagonal matrix
16 0 0 0
5 2 0 0
9 11 3 0
4 7 10 13
0 14 6 8
0 0 15 12
0 0 0 1
  댓글 수: 1
Dana
Dana 2020년 7월 7일
If you want help. you should provide a much more detailed question. I have no idea what you're asking here.

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 7월 8일
full(spdiags(B',0:-1:-3,7,4))

추가 답변 (2개)

KSSV
KSSV 2020년 7월 8일
Read about diag.
iwant = diag(1:5)+diag(1:4,-1)+diag(1:4,1) ;

madhan ravi
madhan ravi 2020년 7월 8일
[m, n] = size(B);
ix = (1 : 2*m : n*2*m) + (0 : n - 1).';
Wanted = zeros(2*m - 1 , n);
Wanted(ix) = B

카테고리

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

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by