av久久久-av九九九-av九九-av激情网-欧美三级在线-欧美三级一区二区三区

子空間夾角計算-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




主站蜘蛛池模板: 闲章内容大全图片| 青草视频在线观看视频| 乡村女教师乱淫交片| 退社申请书800字| 申河均| 坏孩子电影| va视频在线| 卜算子咏梅拼音| 美女xxx69爽爽免费观妞| 大侠霍元甲演员表| 澳门风云2演员表| 童女之舞| 女奥特曼:苍月女战士在线观看| 赵立军| 燃烧的岁月| 陈学冬颖儿主演电视剧《解密》| 禁忌爱情| 母亲电影韩国完整版免费观看| 当代大学德语2答案| 林丹出轨视频| 张国荣身高| www.douyin.com官网| 廊桥遗梦中被剪掉的一段| 山海经动画片全40集免费观看| 被抛弃的青春1982| 抖音下截| 甄嬛传演员表| 土壤动植物的乐园教学反思| 乱世三人行| 少爷和我短剧| 肖传国| 张静初的三级未删减版| 日本电影致命诱惑| 用力快点| 国生小百合| 秦时明月动画片| 魔影| 赖小子| 张柏芝惊艳照片| 读书笔记经典常谈| 破冰 电影|