How to write program for this block matrix

조회 수: 12 (최근 30일)
Vijayalakshmi R
Vijayalakshmi R 2022년 1월 3일
댓글: Image Analyst 2022년 1월 3일
Row1 0 0 0 0 | 0 0 1 0,
Row2 0 0 0 0 | 0 0 0 1,
Row3 0 0 0 0 | 1 0 0 0,
Row4 0 0 0 0 | 0 1 0 0,
Row5 0 0 1 0 | 0 0 0 0,
Row6 0 0 0 1 | 0 0 0 0,
Row7 1 0 0 0 | 0 0 0 0,
Row8 0 1 0 0 | 0 0 0 0
Order of matrix 4×4

채택된 답변

Matt J
Matt J 2022년 1월 3일
A=zeros(4);
B=[ 0 0 1 0;
0 0 0 1;
1 0 0 0;
0 1 0 0 ];
final=[A,B;B',A]
final = 8×8
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
  댓글 수: 2
Vijayalakshmi R
Vijayalakshmi R 2022년 1월 3일
Thank you for your immediate response.
Matt J
Matt J 2022년 1월 3일
You're welcome, but if this answer addresses the question, please Accept-click it.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 1월 3일
Not sure I understand. Am I missing something? Isn't it just
m = [...
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0]
??? It seems so trivial, so I'm not sure what you're asking.
And the order of that matrix is 8-by-8, not 4-by-4.
  댓글 수: 2
Vijayalakshmi R
Vijayalakshmi R 2022년 1월 3일
Sir, block size is 4×4
Image Analyst
Image Analyst 2022년 1월 3일
Again, I don't understand. What do you mean by block size? Didn't Matt and I both give you code that creates your desired matrix? Or not? I know you're a man of very few words, but you're going to have to do a lot more explaining to make us understand why we're not meeting your needs in creating the output matrix you asked for.

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

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by