P0W*_*P0W 6

使用eye函数获取单位矩阵并添加到原始矩阵

result = A+eye(3,3) ; % A the original matrix 
Run Code Online (Sandbox Code Playgroud)