Shifting elements and replacing empty places with zeros

조회 수: 1 (최근 30일)
Ritu Giri
Ritu Giri 2023년 8월 24일
댓글: Matt J 2023년 8월 29일
How to convert matrix A =[3 ,7, 9, 2] to matrix B = [3, 7, 9, 2; 0, 3, 9, 2; 0, 0, 3, 9; 0, 0, 0, 3] using matlab

채택된 답변

Matt J
Matt J 2023년 8월 24일
편집: Matt J 2023년 8월 24일
The B that you have provided is not what the title of your post describes. I assume you meant the following,
A =[3 ,7, 9, 2];
B=toeplitz([A(1),zeros(1,numel(A)-1)],A)
B = 4×4
3 7 9 2 0 3 7 9 0 0 3 7 0 0 0 3
  댓글 수: 5
Ritu Giri
Ritu Giri 2023년 8월 29일
Can you please on that?
Matt J
Matt J 2023년 8월 29일
No, because that would probably be a homework problem.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by