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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by