matlab:一般迭代法求非线性方程x^3+4*x^2-10=0的根程序
时间: 2024-01-05 14:21:08 浏览: 86
以下是使用一般迭代法求解非线性方程x^3+4*x^2-10=0的根的Matlab程序:
```matlab
% 定义迭代函数
function y = g(x)
y = (10 - 4*x^2)^(1/3);
end
% 定义初始值和误差限
x0 = 1; % 初始值
epsilon = 1e-6; % 误差限
% 迭代计算
x = x0;
while abs(x - g(x)) > epsilon
x = g(x);
end
% 输出结果
root = x;
disp(['The root of the equation x^3+4*x^2-10=0 is: ', num2str(root)]);
```
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![xlsx](https://img-home.csdnimg.cn/images/20210720083732.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)