mudf2c.m

来自「GPS software toolbox for GPS receiver de」· M 代码 · 共 31 行

M
31
字号
%   				                  mudf2c.m
%  Scope:   This MATLAB macro determines the compact upper triangular part stored 
%           columnwise as a one-dimensional array from the full U and D matrices 
%           stored as two-dimensional arrays.
%  Usage:   xout = mudf2c(n,u,d)
%  Description of parameters:
%           n    - input, real scalar, number of rows and columns of the 
%                  symmetric matrix
%           u    - input, two-dimensional array storing the full U matrix
%           d    - input, two-dimensional array storing the full D matrix
%           xout - output, one-dimensional array of length  n*(n+1)/2, storing 
%                  columnwise the U-D components of a symmetric matrix
%  Last update:  08/06/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

function   xout = mudf2c(n,u,d)

nn1 = n*(n+1)/2;
xout = zeros(1,nn1);
kt = 0;
for k = 1:n
   ktt = kt;
   for kk = 1:k
      kt = kt + 1;
      if k == kk
         xout(kt) = d(k,k);
      else
         xout(kt) = u(kk,k);
      end   
   end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?