?? msc2f.m
字號:
% msc2f.m
% Scope: This MATLAB macro determines the real symmetric matrix stored as
% a two-dimensional array from its upper triangular part stored
% columnwise as a one-dimensional array.
% Usage: xout = msc2f(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 upper triangular part of the symmetric matrix
% xout - output, two-dimensional array storing the full symmetric
% matrix
% Last update: 07/19/00
% Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.
function xout = msc2f(n,a)
temp = zeros(1,n);
xout = 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) = a(ktt);
kt = kt + 1;
end
if (k ~= n)
for kk = k:n-1
ktt = ktt + kk;
i = i + 1;
temp(i) = a(ktt);
end
end
xout(k,:) = temp(1,:);
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -