Shifting elements and replacing empty places with zeros

1 vue (au cours des 30 derniers jours)
Ritu Giri
Ritu Giri le 24 Août 2023
Commenté : Matt J le 29 Août 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

Réponse acceptée

Matt J
Matt J le 24 Août 2023
Modifié(e) : Matt J le 24 Août 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 commentaires
Ritu Giri
Ritu Giri le 29 Août 2023
Can you please on that?
Matt J
Matt J le 29 Août 2023
No, because that would probably be a homework problem.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by