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

7 Ansichten (letzte 30 Tage)
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 Kommentare
kaixi gu
kaixi gu am 4 Mär. 2023
yes i know i can not put a 1*11douuble into the matrx. But is there any ways i can use the loop or something to make each value of q and each value of F into the matrix? If I manualy put each value of q and each value of F2y. I would probably need to type the matrix 121 times. I certainly just want each value of q for the corespondinbg each value of F
Shree Charan
Shree Charan am 7 Apr. 2023
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

埃博拉酱
埃博拉酱 am 7 Apr. 2023
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

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by