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

📄 ex4_12.m

📁 Advanced Engineering Mathematics using MATLAB by Harman, Dabney, Richert,书中全部源码
💻 M
字号:
% EX4_12.M Demonstrate Caley-Hamilton theorem%   as in Example 4.12 for A^2-(a+d)*A+(ad-bc)*I=0.%  (This requires the Symbolic Math Toolbox)%fprintf('Test of Caley-Hamilton theorem \n')A=sym('[a,b;c,d]')      % General 2x2 matrixI=sym('[1,0;0,1]');     % Identityc1='a+d';c2='a*d-b*c';Aconst=sym(c2)*sym(I);    % Compute constant termAlin=sym(c1)*sym(A);      % Linear termAsq=sym(A)^2;             % A^2R1=sym(Aconst)-sym(Alin); % Sum the termsR2=sym(Asq)+sym(R1);%  fprintf('Strike a key to continue \n')pausefprintf('Result = A^2-(a+d)*A+(ad-bc)*I =0? \n')Result=simplify(R2)%% Version 5 Replaced symmul, etc.

⌨️ 快捷键说明

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