a 4x4 stiffness matrix 𝑲 is given as: 𝑲 = [12 −4 −2 0 −4 10 −3 1 −2 −3 5 −1 0 1 −1 6 ]what will be the output of 𝑲(11) and 𝑲(1,10) =9. in matlab

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

output1 = K(11);
output2 = K(1, 10);

disp(output1);
disp(output2);
133 chars
8 lines

The output for K(11) will be an error since the matrix K is 4x4 and the index 11 is out of bounds.

The output for K(1, 10) will be '9' because indexing in MATLAB starts from 1 and goes column-wise, meaning it will select the element in row 1, column 2 of the matrix K which is '9'.

related categories

gistlibby LogSnag