Householder Reduction Matlab Version

function [T, P] = householder(A)
% Formations: RA = T, where A is original matrix
% The implementation of Householder Reduction
% R is constructed as a product of elementary reflector
% T is upper triangular matrix

% Author: Zhenlin Du(Johnsondu)
% Email:  [email protected]
% Time:   2014-11-28 14:00

A = double(A)
[m, n] = size(A); % m- number of rows, n- number of columns

iter = 0;
if m > n
    iter = n;
else
    iter = m - 1;
end

T = A;
P = eye(m);

for i = 1 : iter
    % take the first column
    u = T(i:m, i);
    % construct identity matrix
    I = eye(m-i+1);
    e1 = I (:, 1);
    % u is elementary relector.
    u = u - norm(u) * e1;
    R11 = eye(m-i+1) - 2 * (u * u') / (u' * u);
    R1 = eye(m);
    for j = i: m
        R1(j, i: m) = R11(j-i+1, :);
    end
    T = R1 * T;
    P = R1 * P;
end

时间: 2024-10-10 07:55:51

Householder Reduction Matlab Version的相关文章

PLU decomposition Matlab version

function [P, L, U] = plu(A) % The implementation of PLU Factorization % L is lower triangular and U is upper triangular % P is permutation matrix % Author: Zhenlin Du(Johnsondu) % Email: [email protected] % Time: 2014-11-27 22:00 A = double(A); [m, n

Gram Shimidt QR Factorization Matlab version

function [Q,R] = gram_schmidt_qr(A) % Formation: A = QR % The implementation of QR Factorization(classical Gram-Schmidt method) % Q is orthonormal basis for R(A) % R is an upper-triangular matrix with positive diagonal entries. % Author: Zhenlin Du(J

matlab分布式平台

一.Matlab R2014b安装教程 1,下载Matlab R2014b ISO格式安装包 2,以winrar格式解压缩ISO文件,出现下图所示的文件列表 3,进入Matlab2014b crack.rar中jar文件,将其中的ValidatedFikImpl.class和InstallerBuilderImpl.class文件复制替换到 上述解压缩文件夹内的路径 \java\jar\install.jar压缩文件的\com\mathworks\install\目录下: 直接向Winrar所打

Linux版Matlab R2015b的bug——脚本运行的陷阱(未解决)

0 系统+软件版本 系统:CentOS 6.7 x64, 内核 2.6.32-573.el6.x86_64软件:Matlab R2015b(包括威锋网和东北大学ipv6下载的资源,都测试过) 1 bug描述 1.1 未知的“陷阱” 首先,这个程序在Matlab R2013a中可以完美运行,这个“陷阱“在是新安装的R2015b上才出现的. 说它是“陷阱“,是因为脚本文件涉及到大量的数据处理,比如一个几百次的循环,它可能在执行某一句的时候就失去响应了,可能是一个循环,也可能是单句,仿佛掉进了一个未知

浅谈压缩感知(七):常见测量矩阵的MATLAB实现

1.随机高斯测量矩阵 function [ Phi ] = GaussMtx( M,N ) %GaussMtx Summary of this function goes here % Generate Bernoulli matrix % M -- RowNumber % N -- ColumnNumber % Phi -- The Gauss matrix %% Generate Gauss matrix Phi = randn(M,N); %Phi = Phi/sqrt(M); end 2

matlab toolboxes 大全

MATLAB Toolboxes top (Top) Audio - Astronomy - BiomedicalInformatics - Chemometrics  - Chaos - Chemistry - Coding - Control - Communications - Engineering - Data Mining - Excel - FEM - Fuzzy - Finance - GAs - Graph - Graphics - Images - ICA - Kernel 

Linux x64 下 Matlab R2013a 300 kb 脚本文件调试的 CPU 占用过高问题的解决办法

(1) 系统+软件版本 CentOS 6.5 (Final), 64 位,内核initramfs-2.6.32-431.5.1.el6.x86_64, MATLAB Version: 8.1.0.604 (R2013a)     Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode (2) 问题描述 通常在这个环境下,小文件的代码都可以调试通过. 最近,把所有函数集合到一

Matlab Issues [001]

Matlab R2014a保存较大变量(大于2G时)时,出现如下错误: >> save('D.mat','D');Warning: Variable 'D' cannot be saved to a MAT-file whose version is older than 7.3.To save this variable, use the -v7.3 switch.Skipping... 解决方法[1]: save -v7.3 D.mat D; 解决方法[2]:通过Preferences/G

《DSP using MATLAB》Problem 2.6

1.代码 %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 2.6.1 \n\n'); [v, d] =