⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mudc2f.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%   				                  mudc2f.m
%  Scope:   This MATLAB macro determines the full U and D matrices stored as
%           two-dimensional arrays from its compact upper triangular part stored 
%           columnwise as a one-dimensional array.
%  Usage:   [u,d] = mudc2f(n,a)
%  Description of parameters:
%           n    - input, real scalar, number of rows and columns of the 
%                  symmetric matrix
%           a    - input, one-dimensional array of length  n*(n+1)/2, storing 
%                  columnwise the U-D components of a symmetric matrix
%           u    - output, two-dimensional array storing the full U matrix
%           d    - output, two-dimensional array storing the full D matrix
%  Last update:  07/19/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

function   [u,d] = mudc2f(n,a)

temp = zeros(1,n);
u = zeros(n,n);
d = zeros(n,n);
kt = 0;
for k = 1:n
   i = 0;
   ktt = kt;
   for kk = 1:k
      i = i + 1;
      ktt = ktt + 1;
      temp(i) = 0;
      kt = kt + 1;
   end
   temp(i) = 1.;
   d(k,k) = a(ktt);
   if  (k ~= n)
      for  kk = k:n-1
         ktt = ktt + kk;
         i = i + 1;
         temp(i) = a(ktt);
      end
   end
   u(k,:) = temp(1,:);
end

⌨️ 快捷键说明

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