How can I generate symmetric array?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have an array. and i want to write it symmetry
A(:,:,k) = [ 1 2 3 4 5 6 7 8 9 10];
I want to write it as
A(:,:,k) = [ 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1];
for k=1:N
value of A should change according perms or permutation. because perms is limited to 10.
please help.
댓글 수: 0
채택된 답변
Walter Roberson
2015년 12월 16일
Write the asymmetric matrix first, just the first half. Then
A = cat(3,A, A(:,:,end:-1:1));
This will put a reversed copy of A after A
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!