a 4x4 stiffness matrix 𝑲 is given as: 𝑲 = [12 −4 −2 0 −4 10 −3 1 −2 −3 5 −1 0 1 −1 6 ]set all values of 𝑲 below the diagonal to zero to create an upper triangular matrix. in matlab

main.m
K = [12, -4, -2, 0; -4, 10, -3, 1; -2, -3, 5, -1; 0, 1, -1, 6];
K_triu = triu(K);
82 chars
3 lines

related categories

gistlibby LogSnag