matlab解方程组方程组1:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2-n*sin(c/2+d)+e*cos(f-b))^2-(h+n*cos(c/2+d)-e*sin(f-b))^2=0;方程组2:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2+e*cos(a+f)-n*sin(c/2-d))^2-(h
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/07 13:37:49
matlab解方程组方程组1:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2-n*sin(c/2+d)+e*cos(f-b))^2-(h+n*cos(c/2+d)-e*sin(f-b))^2=0;方程组2:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2+e*cos(a+f)-n*sin(c/2-d))^2-(h
matlab解方程组
方程组1:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2-n*sin(c/2+d)+e*cos(f-b))^2-(h+n*cos(c/2+d)-e*sin(f-b))^2=0;
方程组2:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2+e*cos(a+f)-n*sin(c/2-d))^2-(h+n*cos(c/2-d)-e*sin(a+f))^2=0;
我想建立个函数 function f=myfun(b,c,e,f,h,m,n)
能把 两个方程组中的 ‘a’,‘d’作为未知数,其他字母通过参数传递,解方程组.
要求:输入 myfun(1,2,3,4,5,6,7)能得出 a和b的结果(不要复数解).
注:这2次带三角函数的方程组.a或者b 应该有两组(或者两组以上)实数解.
matlab解方程组方程组1:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2-n*sin(c/2+d)+e*cos(f-b))^2-(h+n*cos(c/2+d)-e*sin(f-b))^2=0;方程组2:(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2+e*cos(a+f)-n*sin(c/2-d))^2-(h
function F=mymagic(x,b,c,e,f,h,m,n)
F=[(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2-n*sin(c/2+x(2))+e*cos(f-b))^2-(h+n*cos(c/2+x(2))-e*sin(f-b))^2
(m/2-n*sin(c/2)+e*cos(f))^2+(h+n*cos(c/2)-e*sin(f))^2-(m/2+e*cos(x(1)+f)-n*sin(c/2-x(2)))^2-(h+n*cos(c/2-x(2))-e*sin(x(1)+f))^2];
fsolve(@(x) mymagic(x,1,2,3,4,5,6,7),[0;0])
上面是函数,下面是调用的语句,其中最后的[0;0]是迭代的初值,这里使用了fsolve进行数值求解,求解的方法就是牛顿迭代法!
祝你学习愉快!