フィルターのクリア

matrix in special arrangment for cycler gemetry

2 ビュー (過去 30 日間)
mohammed hussein
mohammed hussein 2021 年 2 月 27 日
コメント済み: mohammed hussein 2021 年 2 月 27 日
hello every one
thank you very much for helping
i have big matrix for motor geometry i want to make special arrangement to respect complete circle of motor
for example i have this small matrix
A=[11 12 13 14 15]
i want to change it to
A=[11 12 13 14 15
12 11 12 13 14
13 12 11 12 13
14 13 12 11 12
15 14 13 12 11]
thank you very much again for helping
  2 件のコメント
Shreesha Subrahmanya
Shreesha Subrahmanya 2021 年 2 月 27 日
hi hussein,
please try below code. it will help. let me know if it worked for you :)
A =[11 12 13 14 15];
B =zeros(length(A))
for n = 1:length(A)
B(n,n:end)= A(1,1:end-(n-1))
end
V = B+B'- (diag(ones(1,length(A)))*A(1))
mohammed hussein
mohammed hussein 2021 年 2 月 27 日
編集済み: mohammed hussein 2021 年 2 月 27 日
Thank you very much , it works perfectly
is there any way to get it without for loop , i have very long matrix it takes very long time

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

採用された回答

Bruno Luong
Bruno Luong 2021 年 2 月 27 日
編集済み: Bruno Luong 2021 年 2 月 27 日
>> A=[11 12 13 14 15]
A =
11 12 13 14 15
>> toeplitz(A,A)
ans =
11 12 13 14 15
12 11 12 13 14
13 12 11 12 13
14 13 12 11 12
15 14 13 12 11
  1 件のコメント
mohammed hussein
mohammed hussein 2021 年 2 月 27 日
thank you very much .

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by