📄 clcondno.m
字号:
% CLCONDNO.M Solve A*x=b for A a 5x5 Hilbert matrix% x=[1 1 1 1 1] is answer; xcomp is computed vector% OUTPUT: Condition number (condA) and xerror=xcomp-x% format rat % Show rational valuesformat compact % and suppress blank linesA=hilb(5); % Hilbert matrixb=[137/60 87/60 459/420 743/840 1879/2520]';x=[1 1 1 1 1]; % Exact answer % Check condition number and solvefprintf('Condition number and error in xcomp:\n')condA=cond(A) % Display condition numberformat long % Format decimal valuesxcomp=A\b; % Computed value of solutionfprintf('Error in calculated value xcomp(I), I=1,5\n')xerror=xcomp - x'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -