久久精品草-久久精品成人-久久精品成人免费网站-久久精品成人欧美大片免费-香港三级大全-香港三级日本三级a视频

子空間夾角計算-MATLAB源代碼修正

2017-01-16  by:CAE仿真在線  來源:互聯網

function theta = subspace(A,B)
%SUBSPACE Angle between subspaces.
% SUBSPACE(A,B) finds the angle between two subspaces specified by the
% columns of A and B.
%
% If the angle is small, the two spaces are nearly linearly dependent.
% In a physical experiment described by some observations A, and a second
% realization of the experiment described by B, SUBSPACE(A,B) gives a
% measure of the amount of new information afforded by the second
% experiment not associated with statistical errors of fluctuations.
%
% Class support for inputs A, B:
% float: double, single

% The algorithm used here ensures that small angles are computed
% accurately, and it allows subspaces of different dimensions following
% the definition in [2]. The first issue is crucial. The second issue is
% not so important; but since the definition from [2] coinsides with the
% standard definition when the dimensions are equal, there should be no
% confusion - and subspaces with different dimensions may arise in
% problems where the dimension is computed as the numerical rank of some
% inaccurate matrix.

% References:
% [1] A. Bjorck & G. Golub, Numerical methods for computing
% angles between linear subspaces, Math. Comp. 27 (1973),
% pp. 579-594.
% [2] P.-A. Wedin, On angles between subspaces of a finite
% dimensional inner product space, in B. Kagstrom & A. Ruhe (Eds.),
% Matrix Pencils, Lecture Notes in Mathematics 973, Springer, 1983,
% pp. 263-285.

% Thanks to Per Christian Hansen
% Copyright 1984-2007 The MathWorks, Inc.
% $Revision: 5.10.4.3 $ $Date: 2007/09/18 02:15:38 $

% Compute orthonormal bases, using SVD in "orth" to avoid problems
% when A and/or B is nearly rank deficient.
A = orth(A);
B = orth(B);
%Check rank and swap
if size(A,2) < size(B,2)
tmp = A; A = B; B = tmp;
end
% Compute the projection the most accurate way, according to [1].
for k=1:size(A,2)
B = B - A(:,k)*(A(:,k)'*B);
end

% Make sure it's magnitude is less than 1.
theta = asin(min(ones(superiorfloat(A,B)),(norm(B))));


%說明

以下代碼

for k=1:size(A,2)
B = B - A(:,k)*(A(:,k)'*B);
end


相當于如下公式計算:

B = (eye(size(A,1))-A*A')*B;

這樣可以減少循環次數,提高計算速度;



矩陣B的特征值即為夾角正弦值

theta = asin(min(ones(superiorfloat(A,B)),(norm(B))));


superiorfloat() 返回 'single','double'...即A,B的數據類型

ones('double') 返回 1

以上代碼說明,夾角正弦值應該小于等于1,當B的特征值大于1時,取1。




開放分享:優質有限元技術文章,助你自學成才

相關標簽搜索:子空間夾角計算-MATLAB源代碼修正 MatLab培訓 MatLab培訓課程 MatLab在線視頻教程 MatLab技術學習教程 MatLab軟件教程 MatLab資料下載 MatLab代做 MatLab基礎知識 Fluent、CFX流體分析 HFSS電磁分析 Ansys培訓 Abaqus培訓 

編輯
在線報名:
  • 客服在線請直接聯系我們的客服,您也可以通過下面的方式進行在線報名,我們會及時給您回復電話,謝謝!
驗證碼

全國服務熱線

1358-032-9919

廣州公司:
廣州市環市中路306號金鷹大廈3800
電話:13580329919
          135-8032-9919
培訓QQ咨詢:點擊咨詢 點擊咨詢
項目QQ咨詢:點擊咨詢
email:kf@1cae.com




主站蜘蛛池模板: 97在线观看完整免费 | 向日葵视频app在线观看 | 在线观看亚洲免费视频 | 91视频一区二区三区 | 特大毛片| 免费观看呢日本天堂视频 | 亚洲二三区 | 不卡一区在线观看 | 四虎影院在线播放视频 | 色婷婷精品免费视频 | 欧美亚洲综合图区在线 | 4hu四虎最新免费地址 | 污污网站观看 | 狠狠色丁香婷婷久久综合考虑 | 青草成人| 国内在线亚洲精品第一线 | www.四虎影院.con | 成年女人18毛片毛片免费 | 韩国伦理妈妈的朋友在线观看 | 欧美xxxx色视频在线观看 | 99久草| 失乐园电视剧日本第6集 | chinese在线播放91国内 | 亚洲性久久久影院 | 自拍偷拍网站 | 一本大道香蕉高清久久 | 在线精品自拍亚洲第一区 | 榴莲视频丝瓜无限视频app | 国产乱对白刺激视频在线观看 | 美国美女一级毛片免费全 | 九九视频精品在线 | 青青草手机视频在线观看 | 亚洲不卡av不卡一区二区 | 免费国内精品久久久久影院 | 日韩成人精品日本亚洲 | 亚洲日本一区二区 | 亚洲第一区第二区 | 久久久久久国产精品免费免 | 在线视频亚洲 | 国产4tube在线播放 | 久久va|