Error with matrix calculation
% matrix calculation
M3 = [0 0 0 0 -1 0 0 0 0 0 1 0;
0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 -0.05 1;
1 0 0 0 0 0 0 0 -1 0 -1 0;
0 -1 0 0 0 0 0 0 0 -1 0 0;
-0.15 0 0 0 0 0 0 0 -0.15 0 0.05 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;
-0.4*sind(20) -0.4*cosd(20) -0.4*sind(20) 0.4*cosd(20) 0 0 0 0 0 0 0 0;
0 0 0 -1 0 0 0 1 0 0 0 0;
0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 0 0];
N3 = [mass_body1*Acceleration_G1x;
mass_body1*Acceleration_G1y+mass_body1*9.81;
mass_body1*radius_body1^2*alpha_1;
mass_body2*Acceleration_G2x;
mass_body2*Acceleration_G2y+mass_body2*9.81;
(1/12)*mass_body2*radius_body2^2*alpha_2;
mass_body3*Acceleration_G3x;
mass_body3*Acceleration_G3y+mass_body3*9.81;
(1/12)*mass_body3*radius_body3^2*alpha_3;
mass_body4*Acceleration_G4x;
mass_body4*Acceleration_G4y+mass_body4*9.81;
(1/12)*mass_body4*BD^2*alpha_4];
X = M3/N3
It says that there is an error using "/" and that matrix dimensions must agree. I dont know exactly what this means, and can’t find where the issue is. The error is in the line "X = M3/N3"% matrix calculation
M3 = [0 0 0 0 -1 0 0 0 0 0 1 0;
0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 -0.05 1;
1 0 0 0 0 0 0 0 -1 0 -1 0;
0 -1 0 0 0 0 0 0 0 -1 0 0;
-0.15 0 0 0 0 0 0 0 -0.15 0 0.05 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;
-0.4*sind(20) -0.4*cosd(20) -0.4*sind(20) 0.4*cosd(20) 0 0 0 0 0 0 0 0;
0 0 0 -1 0 0 0 1 0 0 0 0;
0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 0 0];
N3 = [mass_body1*Acceleration_G1x;
mass_body1*Acceleration_G1y+mass_body1*9.81;
mass_body1*radius_body1^2*alpha_1;
mass_body2*Acceleration_G2x;
mass_body2*Acceleration_G2y+mass_body2*9.81;
(1/12)*mass_body2*radius_body2^2*alpha_2;
mass_body3*Acceleration_G3x;
mass_body3*Acceleration_G3y+mass_body3*9.81;
(1/12)*mass_body3*radius_body3^2*alpha_3;
mass_body4*Acceleration_G4x;
mass_body4*Acceleration_G4y+mass_body4*9.81;
(1/12)*mass_body4*BD^2*alpha_4];
X = M3/N3
It says that there is an error using "/" and that matrix dimensions must agree. I dont know exactly what this means, and can’t find where the issue is. The error is in the line "X = M3/N3" % matrix calculation
M3 = [0 0 0 0 -1 0 0 0 0 0 1 0;
0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 -0.05 1;
1 0 0 0 0 0 0 0 -1 0 -1 0;
0 -1 0 0 0 0 0 0 0 -1 0 0;
-0.15 0 0 0 0 0 0 0 -0.15 0 0.05 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;
-0.4*sind(20) -0.4*cosd(20) -0.4*sind(20) 0.4*cosd(20) 0 0 0 0 0 0 0 0;
0 0 0 -1 0 0 0 1 0 0 0 0;
0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 (BD/2)*cosd(Angle_FBD) (BD/2)*sind(Angle_FBD) 0 0 0 0];
N3 = [mass_body1*Acceleration_G1x;
mass_body1*Acceleration_G1y+mass_body1*9.81;
mass_body1*radius_body1^2*alpha_1;
mass_body2*Acceleration_G2x;
mass_body2*Acceleration_G2y+mass_body2*9.81;
(1/12)*mass_body2*radius_body2^2*alpha_2;
mass_body3*Acceleration_G3x;
mass_body3*Acceleration_G3y+mass_body3*9.81;
(1/12)*mass_body3*radius_body3^2*alpha_3;
mass_body4*Acceleration_G4x;
mass_body4*Acceleration_G4y+mass_body4*9.81;
(1/12)*mass_body4*BD^2*alpha_4];
X = M3/N3
It says that there is an error using "/" and that matrix dimensions must agree. I dont know exactly what this means, and can’t find where the issue is. The error is in the line "X = M3/N3" matrix MATLAB Answers — New Questions