Info

This question is locked. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

some other matrices matrix

조회 수: 4 (최근 30일)
Mücahit Özalp
Mücahit Özalp 2021년 6월 16일
Locked: Rena Berman 2024년 7월 30일
N=5;
C=sparse(zeros(N-1));
C([1 end])=C([1 end])+1;
B=speye(N-1);
B([1 end])=B([1 end])-1/2;
I have B and C matrices. I can form a blockdiagonal matrix such that C on the diagonal. As follows;
E0=speye(N);
E0=E0(1:end-1,1:end-1);
T2=kron(E0,C);
But I want to change the first and the last blocks with the matrix B.( In the first block and last block instead of C there should be B matrix.)
How can I do that? (N will be a variable so the size of the matrix will change according to the written N value.)
  댓글 수: 1
Rena Berman
Rena Berman 2024년 7월 30일

(Answers Dev) Restored edit

답변 (1개)

David Hill
David Hill 2021년 6월 16일
Why not use blkdiag() function?
T=blkdiag(B,C,B);

This question is locked.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by