简体   繁体   中英

matlab equation system solver

i can solve the system of equations for an exact value of "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')

but i need solutions according to variable 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')
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM