Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#2 |
高级会员
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21 ![]() |
![]()
clear;
syms a b c t1 t2 t4; [a,b,c]=solve('(a * cos(b) - 0.000)^2 + (a * sin(b) - 0.450)^2 = (a + c * t1(i))^2', '(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.450)^2 = (a + c * t2(i))^2 ', '(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.000)^2 = (a + c * t4(i))^2 ','a','b','c') 应该是这样些的,但是我求解出来没有显式解。估计要用牛顿法计算比较好。我这里有个函数文件,希望可以帮到你: function [R,n]=newton_methods(x0,eps) if nargin==1 eps=1.0e-4; end r=x0-myfun(x0)/dmyfun(x0); n=1; tol=1; while tol>eps x0=r; R=x0-myfun(x0)/dmyfun(x0); tol=norm(r-x0); n=n+1; if(n>100000) disp('迭代步数太多,可能不收敛!'); return; end end 你需要自己编写myfun,就是你的方程。注意写成Equation=0的形式,但只需要Equation部分。 |
![]() |
![]() |
主题工具 | |
显示模式 | |
|
|
![]() |
||||
主题 | 主题作者 | 版面 | 回复 | 最后发表 |
[求助]Matlab中如何添加视频 | azsdf | MATLAB论坛 | 2 | 2009-04-23 04:26 |
[MATLAB毕业设计] 请问如何统计图中有多少个黑点? | rintk | MATLAB论坛 | 0 | 2009-04-12 10:08 |