How to find the corresponding Mathematica commands for diagonal matrix operation in Matlab, e.g.
Step 1.) finding the diagonal elements, and export them as a list "tmp"
tmp = spdiags(AA,0);
Step 2.) modifying one list element
Step 3.) return the changed diagonal elements in matrix backmat
backmat=spdiags(tmp,0,AA); % reinsert diagonal;
How can we define the Step 1 & Step 3 in Mathematica 12.2?