matlab解方程组问题,五个方程,有四个未知数,按照下面写的解不出来,请高手帮忙。
[x,y,z,t]=solve('((500-x)^2+(3300-y)^2+z^2)/(21.15-t)^2=((3200-x)^2+(3100-y)^2+z^2)/(...
[x,y,z,t]=solve('((500-x)^2+(3300-y)^2+z^2)/(21.15-t)^2=((3200-x)^2+(3100-y)^2+z^2)/(17.95-t)^2','((300-x)^2+(200-y)^2+z^2)/(19.4833-t)^2=((3400-x)^2+(100-y)^2+z^2)/(16.8167-t)^2','((800-x)^2+(1600-y)^2+z^2)/(14.85-t)^2=((2500-x)^2+(1900-y)^2+z^2)/(10.2333-t)^2','((1400-x)^2+(2200-y)^2+z^2)/(13.2833-t)^2=((2300-x)^2+(2800-y)^2+z^2)/(14.7833-t)^2','((1700-x)^2+(700-y)^2+z^2)/(11.7667-t)^2=((2900-x)^2+(900-y)^2+z^2)/(11.7667-t)^2','x','y','z','t')
展开
1个回答
展开全部
改用数值解:
1、编写函数:
function f=fun2(in)
x=in(1);y=in(2);z=in(3);t=in(4);
f(1)=((500-x)^2+(3300-y)^2+z^2)/(21.15-t)^2-((3200-x)^2+(3100-y)^2+z^2)/(17.95-t)^2;
f(2)=((300-x)^2+(200-y)^2+z^2)/(19.4833-t)^2-((3400-x)^2+(100-y)^2+z^2)/(16.8167-t)^2;
f(3)=((800-x)^2+(1600-y)^2+z^2)/(14.85-t)^2-((2500-x)^2+(1900-y)^2+z^2)/(10.2333-t)^2;
f(4)=((1400-x)^2+(2200-y)^2+z^2)/(13.2833-t)^2-((2300-x)^2+(2800-y)^2+z^2)/(14.7833-t)^2;
f(5)=((1700-x)^2+(700-y)^2+z^2)/(11.7667-t)^2-((2900-x)^2+(900-y)^2+z^2)/(11.7667-t)^2;
2、调用求解:
fsolve(@(x)fun2(x),x0);% x0可以根据实际确定出大致范围即可
1、编写函数:
function f=fun2(in)
x=in(1);y=in(2);z=in(3);t=in(4);
f(1)=((500-x)^2+(3300-y)^2+z^2)/(21.15-t)^2-((3200-x)^2+(3100-y)^2+z^2)/(17.95-t)^2;
f(2)=((300-x)^2+(200-y)^2+z^2)/(19.4833-t)^2-((3400-x)^2+(100-y)^2+z^2)/(16.8167-t)^2;
f(3)=((800-x)^2+(1600-y)^2+z^2)/(14.85-t)^2-((2500-x)^2+(1900-y)^2+z^2)/(10.2333-t)^2;
f(4)=((1400-x)^2+(2200-y)^2+z^2)/(13.2833-t)^2-((2300-x)^2+(2800-y)^2+z^2)/(14.7833-t)^2;
f(5)=((1700-x)^2+(700-y)^2+z^2)/(11.7667-t)^2-((2900-x)^2+(900-y)^2+z^2)/(11.7667-t)^2;
2、调用求解:
fsolve(@(x)fun2(x),x0);% x0可以根据实际确定出大致范围即可
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询