in this linear matrix. q_1, q_2....the input matrix are 1*11 double. all the F2y,F3x...in the out put are 1*11 double. I want to solve the Sol for each value of input ,output
1 次查看(过去 30 天)
显示 更早的评论
N = numel()
equ = [0 1 0 -1 0 0 0 0 0 0 0 -1;1 0 -1 0 0 0 0 0 0 0 -1 0;0 0 0 0 0 0 0 1 0 -1 0 1;0 0 0 0 0 0 1 0 -1 0 1 0;0 0 0 0 1 0 -1 0 0 0 0 0;0 0 0 0 0 1 0 -1 0 0 0 0;0 0 1 0 -1 0 0 0 0 0 0 0;0 0 0 1 0 -1 0 0 0 0 0 0;0 0 q_4 q_3 0 0 0 0 0 0 q_2 q_1;0 0 0 0 0 0 q_6 q_5 0 0 q_8 q_7;0 0 0 0 q_10 q_9 0 0 0 0 0 0;0 0 q_12 q_11 0 0 0 0 0 0 0 0]
equ_2 = [F2y;F2x;F3y;F3x;F4x;F4y;F5x;F5y;F6x;F6y;M_1;M_2:M_3;M_4];
Sol = inv(equ)*equ_2;
6 个评论
Shree Charan
2023-4-7
Could you please explain 'to make each value of q and each value of F into the matrix' and 'I certainly just want each value of q for the corespondinbg each value of F'. It might be useful to provide an example.
回答(1 个)
埃博拉酱
2023-4-7
Sol=cell(1,11);
for a=1:11
Sol{a}=GetOneSol(q_1(a),q_2(a),q_3(a),q_4(a),q_5(a),q_6(a),q_7(a),q_8(a),q_9(a),q_10(a),q_11(a),q_12(a),F2y(a),F2x(a),F3y(a),F3x(a),F4x(a),F4y(a),F5x(a),F5y(a),F6x(a),F6y(a),M_1,M_2,M_3,M_4);
end
function Sol=GetOneSol(q_1,q_2,q_3,q_4,q_5,q_6,q_7,q_8,q_9,q_10,q_11,q_12,F2y,F2x,F3y,F3x,F4x,F4y,F5x,F5y,F6x,F6y,M_1,M_2,M_3,M_4)
equ = [0 1 0 -1 0 0 0 0 0 0 0 -1;1 0 -1 0 0 0 0 0 0 0 -1 0;0 0 0 0 0 0 0 1 0 -1 0 1;0 0 0 0 0 0 1 0 -1 0 1 0;0 0 0 0 1 0 -1 0 0 0 0 0;0 0 0 0 0 1 0 -1 0 0 0 0;0 0 1 0 -1 0 0 0 0 0 0 0;0 0 0 1 0 -1 0 0 0 0 0 0;0 0 q_4 q_3 0 0 0 0 0 0 q_2 q_1;0 0 0 0 0 0 q_6 q_5 0 0 q_8 q_7;0 0 0 0 q_10 q_9 0 0 0 0 0 0;0 0 q_12 q_11 0 0 0 0 0 0 0 0]
equ_2 = [F2y;F2x;F3y;F3x;F4x;F4y;F5x;F5y;F6x;F6y;M_1;M_2:M_3;M_4];
Sol = inv(equ)*equ_2;
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!