⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex4_7.m

📁 Programs for the book Advanced Engineering Mathematics using MATLAB, 2ndEd.
💻 M
字号:
% EX4_7.M Verify results of Example 4.7
%   Computes determinant and trace of a matrix and compares to
%     product and sum of eigenvalues, respectively.
%
A=[1 -1 0;0 1 1;0 0 -2]   % Define the matrix
detA=det(A)               % Compute the determinant and
traceA=sum(diag(A))       %  Same as trace command
pause
%
% Test using eigenvalues 
%
fprintf(' Determinant and trace from eigenvalues \n')
Eig=eig(A)              % Column vector of eigenvalues 
prodeig=prod(Eig)
traceA1=sum(Eig)

%
%  Modify the script to compute the eigenvalues and 
%   trace of an arbitrary matrix either input during a session
%   or saved in a disk file
%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -