在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
消去变换的定义 可以看到,这个变换很容易实现,只需要就4种不同情况分别定义好相应取值即可,下面是matlab中消去变换的实现 function B = Tij(A,i,j) [m,n] = size(A); B = zeros(m,n); % case 1 B(i,j) = 1/A(i,j); % case 2 for k = [1:i-1 i+1:m] B(k,j) = -1*A(k,j)/A(i,j); end % case 3 for k = [1:j-1 j+1:n] B(i,k) = A(i,k)/A(i,j); end % case 4 for k = [1:i-1 i+1:m] for s = [1:j-1 j+1:n] B(k,s) = A(k,s) - A(k,j)*A(i,s)/A(i,j); end end end 选主元法求逆算法 下面是matlab中的实现 function B = inv_by_Tij(A) [~,n] = size(A); B = zeros(n); C = 1:n; L = zeros(1,n); for i = 1:n [~,j] = max(A(i,C)); A = Tij(A,i,C(j)); L(i) = C(j); C(C==C(j)) = []; end for i = 1:n for j = 1:n B(L(i),j) = A(i,L(j)); end end end 总结 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论