色爱区成人综合网_久久99视频精品_日韩国产欧美一区二区_欧美综合国产_天天碰天天操_欧美片子

子空間夾角計算-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:[email protected]




主站蜘蛛池模板: 天天舔夜夜 | 亚洲第一区在线 | 伊人网91 | 国产亚洲欧美一区二区 | 国产一区二区视频在线观看 | 亚洲看片 | 天天干天天av | 国产精品成人国产乱一区 | 午夜专区| 国产一级做a爰片在线看免费 | 久久久久久国产精品mv | 一区二区三区精品视频 | 午夜电影网址 | 欧美激情a∨在线视频播放 成人免费共享视频 | 伊人网av | 精品三级在线观看 | 天天看夜夜 | 国产精品入口久久 | 成人h动漫在线看 | 欧美一区二区三区四区不卡 | 一级国产视频 | 欧美成人免费 | 天天干干 | 人操人人 | 亚洲国产高清高潮精品美女 | 狠狠做深爱婷婷综合一区 | 国产一级影片 | 可以免费看黄的网站 | 男人的天堂一级片 | 亚洲第一成人在线视频 | 91精品国产91久久久久久吃药 | 欧美一区中文字幕 | 91碰碰 | 久草新 | 亚洲欧美一区二区三区在线 | 成人午夜毛片 | 在线中文字幕第一页 | 中文字幕2021| 日本免费在线视频 | www国产高清 | 国产一级毛片在线视频 |