フィルターのクリア

Create a specific matrix (MATLAB)

2 ビュー (過去 30 日間)
high speed
high speed 2022 年 3 月 6 日
コメント済み: Star Strider 2022 年 3 月 6 日
Dear members
I want create a square matrix in such a way that I got the general form:
For example if we have m=4, we got:
How can I program that please!

採用された回答

Star Strider
Star Strider 2022 年 3 月 6 日
Try this —
M = hankel(1:4,4:-1:1)
M = 4×4
1 2 3 4 2 3 4 3 3 4 3 2 4 3 2 1
.
  2 件のコメント
high speed
high speed 2022 年 3 月 6 日
@Star Strider Thank you! That's what I need
Star Strider
Star Strider 2022 年 3 月 6 日
As always, my pleasure!

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

その他の回答 (1 件)

DGM
DGM 2022 年 3 月 6 日
This is one way:
A = flipud(toeplitz([4 3 2 1]))
A = 4×4
1 2 3 4 2 3 4 3 3 4 3 2 4 3 2 1
  1 件のコメント
high speed
high speed 2022 年 3 月 6 日
@DGM Thank you!

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by