ex7.m

来自「数值分析, 同济大学教材<<现代数值数学和计算>>数值分」· M 代码 · 共 30 行

M
30
字号

syms x;
x1 = (3 * x + 1) / x^2;
x2 = (x^3 - 1) / 3;
x3 = (3 * x + 1)^(1/3);
x4 = 1 / (x * x - 3);
x5 = (3 + 1 / x)^(1/2);
x6 = x - 1 / 3 * ((x^3 - 3 * x - 1) / (x^2 - 1));

non_linear_roots(x1, -20);
non_linear_roots(x2, -20);
non_linear_roots(x3, -20);
non_linear_roots(x4, -20);
non_linear_roots(x5, -20);
non_linear_roots(x6, -20);
% 
% non_linear_roots(x1, -2);
% non_linear_roots(x2, -2);
% non_linear_roots(x3, -2);
% non_linear_roots(x4, -2);
% non_linear_roots(x5, -2);
% non_linear_roots(x6, -2);
% 
% non_linear_roots(x1, 10000000);
% non_linear_roots(x2, 10000000);
% non_linear_roots(x3, 10000000);
% non_linear_roots(x4, 10000000);
% non_linear_roots(x5, 10000000);
% non_linear_roots(x6, 10000000);

⌨️ 快捷键说明

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