matlab方程系统求解器

时间:2012-12-18 21:48:05

标签: matlab variables system intervals equation

我可以求解精确值为“q”的方程组:

[A,B,C,Y]= solve('825*cos(A)+792*cos(B)-446.687*cos(C)=187.069','825*sin(A)+792*sin(B)-446.687*sin(C)=694.126','446.687*cos(C)-280.446*cos(2.778+B)=550','446.687*sin(C)-280.446*sin(2.778+B)=Y')

但我需要根据变量q = 121:10:501:

的解决方案
[A,B,C,Y]= solve('(q+704)*cos(A)+792*cos(B)-446.687*cos(C)=187.069','(q+704)*sin(A)+792*sin(B)-446.687*sin(C)=694.126','446.687*cos(C)-280.446*cos(2.778+B)=550','446.687*sin(C)-280.446*sin(2.778+B)=Y')

1 个答案:

答案 0 :(得分:0)

i = 1;
for q = 121:10:501
    [A(i),B(i),C(i),Y(i)] = solve(['(',num2str(q),'+704)*cos(A)+792*cos(B)-446.687*cos(C)=187.069'],['(',num2str(q),'+704)*sin(A)+792*sin(B)-446.687*sin(C)=694.126'],'446.687*cos(C)-280.446*cos(2.778+B)=550','446.687*sin(C)-280.446*sin(2.778+B)=Y')
i = i+1;
end