Q:

How to label line in Matlab plot

I wrote a code plot 17 lines in the same graph. I want to label all line on the graph . Can u help me ?
clear all
close all
clc

syms w
wn=4000 %rad/s

k=1
for n=0:0.05:0.8

  w=0:10:1884;
  H=1./sqrt((1-(w/wn).^2)+(2*n*w/wn).^2);
  x=w/wn

  plot(x,H)
  title('Time versus Response Graph of n');
  xlabel('Time(s)');
  ylabel('Response(m)');
  k=k+1
  hold on
end

I want to clariy which value is equal to which line.

A:

That's usually done by annotation, and I think it is done manually. Since you have a lot of graphs and not much space, I suggest you use text to add the label at the end of the line. So in the loop add (under ylabel for example)
str = sprintf('   n = %.2f',n);
text(x(end),H(end),str);

This will result in 

As you can see there is an overlap in the beginning because the curves are close to each other. You can hardcode a little offset for the first one as follows: (Annotation is graph dependent so I think it's ok to hardcode this)
if n == 0
    text(x(end),H(end)+.005,str);
else
    text(x(end),H(end),str);
end

Result:

General remarks on your code:

you don't use w symbolic so delete syms w
you don't use k so get rid of it as well
w and x can be moved outside the loop and w/wn can be replaced by x

You can also write this without a loop:
wn=4000; %rad/s

w=0:10:1884;
x=w/wn;
n=0:0.05:0.8;
N = length(n);
H=1./sqrt((1-(ones(N,1)*x).^2)+(2*n.'*x).^2);

plot(x,H)
title('Time versus Response Graph of n');
xlabel('Time(s)');
ylabel('Response(m)');

str = sprintf('   n = %.2f\t',n);
strs = strsplit(str,'\t');
offset = zeros(N,1);
offset(1)=.005;
offset(2)=.001;
text(x(end).*ones(N,1),H(:,end)+offset,strs(1:N));

This way it is easier to adjust the offsets of the different curves. (Note I've added an offset for the second curve as well leading to graph below)

`

