?? homt_computebase.m
字號:
%function [Q0,evl,NSub] = Het_computeBase(hom, A0, unstable_flag, NSub)
%
% Compute an orthonormal basis Q0 for the invariant subspace
% corresponding to the NSub
% most unstable eigenvalues of A0 if unstable_flag = 1
% and most stable eigenvalues of A0 if unstable_flag = 0.
%
% If resizeable_flag is true, then the size of the space NSub may
% be adjusted.
function [Q0,evl,NSub] = Het_computeBase(A0, unstable_flag, NSub)
evl = eig(A0);
if unstable_flag
% Compute all eigenvalues and eigenvectors and check number of unstable
% ones
% Compute eigenvalues and -vectors, ordered
% (the ones with largest norm are first)
[VU, DU] = eigs(A0,size(A0,1),'LM');
% Select first NSub eigenvectors: unstable eigenspace
VU = VU(:,1:NSub);
% Compute orthonormal basis for the eigenspace
[Q0,RU] = qr(VU);
else
% Compute all eigenvalues and eigenvectors and check number of stable
% ones
% Compute eigenvalues and -vectors, ordered
% (the ones with smallest norm are first)
[VS, DS] = eigs(A0,size(A0,1),'SM');
% Select first NSub eigenvectors: stable eigenspace
VS = VS(:,1:NSub);
% Compute orthonormal basis for the eigenspace
[Q0,RS] = qr(VS);
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -