フィルターのクリア

How to fast create a specific matrix

2 ビュー (過去 30 日間)
Xiaolong
Xiaolong 2019 年 6 月 21 日
コメント済み: Xiaolong 2019 年 6 月 21 日
I want to generate a matrix with the same pattern but different size.
pattern: for a matrix with size [4 4]
[ 0 0 0 0;
0 0 0 1;
0 0 1 2;
0 1 2 3]
The matrix is always square. The size is often more than 256 in practice. I can generate this kind of matrix using for-loop. But it's too slow.
How to fast create this kind of matrix?

採用された回答

Matt J
Matt J 2019 年 6 月 21 日
hankel(zeros(1,4),0:3)
  1 件のコメント
Xiaolong
Xiaolong 2019 年 6 月 21 日
Clean and Clear

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by