a 4x4 stiffness matrix 𝑲 is given as: 𝑲 = [12 −4 −2 0 −4 10 −3 1 −2 −3 5 −1 0 1 −1 6 ]extract the first, third row and second, fourth column elements of the matrix 𝑲. in matlab

main.m
K = [12, -4, -2, 0; -4, 10, -3, 1; -2, -3, 5, -1; 0, 1, -1, 6];
row_indices = [1, 3];
col_indices = [2, 4];

selected_elements = K(row_indices, col_indices);
disp(selected_elements);
183 chars
7 lines

related categories

gistlibby LogSnag