Find below a simple example;
A = rand(3);
B = rand(3,2);
C = eye(3);
sys = ss(A,B,C,D);
K = lqr(sys,eye(3)*1e5,eye(2));
sysCL = feedback(sys*K,eye(3));
In the future, be more specific on which part you are struggling with and what you have done so far, inwhich case the answers would be a lot more beneficial for you.