Shifting elements and replacing empty places with zeros

1 Ansicht (letzte 30 Tage)
Ritu Giri
Ritu Giri am 24 Aug. 2023
Kommentiert: Matt J am 29 Aug. 2023
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

Akzeptierte Antwort

Matt J
Matt J am 24 Aug. 2023
Bearbeitet: Matt J am 24 Aug. 2023
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 Kommentare
Ritu Giri
Ritu Giri am 29 Aug. 2023
Can you please on that?
Matt J
Matt J am 29 Aug. 2023
No, because that would probably be a homework problem.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by