I want to copy all the elements above the diagonal (not diagonal) under the diagonal without using any cycle or at minimal cost. So, after copying, the matrix will become a symmetric matrix:i.e. for all i, j: A(i,j)=A(j,i).
i
j
A(i,j)=A(j,i)
Thank.
Use the command triu:
triu
>> symMat = triu( A, 0 ) + triu( A, 1 ).';
This command will leave the diagonal Aunchanged.
A
Source: https://habr.com/ru/post/1795004/More articles:Should I use (non-blocking) NIO for UDP? - javaConvert Upper Triangular Matrix MATLAB - matlabJava nio udp broadcast - javamultiplication result negative zero - pythonSave form data in browser backward or forward - javascriptFlask deployment on cherokee and uwsgi - pythonHow to use a partial layout with a collection? Rails - collectionsGet index of objects in java list - javaPHP exec python not working - pythonJQuery loop synchronization - jqueryAll Articles