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

📄 a141.m

📁 matlab算法集 matlab算法集
💻 M
字号:
       %----------------------------------------------------------------
       % Example a1.4.1: Eigenvalues and Eigenvectors
       %----------------------------------------------------------------

       % Initialize 

       clc                     % clear command window
       clear                   % clear variables
       n = 4;                  % size of matrix 
       randinit(2000)          % select random sequence
       A = randu (n,n,-1,1);

       % Find eigenvalues and eigenvectors 

       fprintf ('Example a1.4.1: Eigenvalues and Eigenvectors\n');       
       show ('A',A)
       a = poly(A);
       show ('characteristic polynomial coefficients',a')
       c = eig (A);
       show ('eigenvalues',c)
       [X,C] = eig (A);
       show ('eigenvectors',X)
       t = abs(trace(A) - sum(c));
       show ('trace check',t)
       %----------------------------------------------------------------

⌨️ 快捷键说明

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