MATLAB: I want to see the legend for each n

for looplegend

My graph is showing for each n but legend doesn't working. How to solve the problem?
for n=linspace(1,length(t),10)
plot(x/L,(c(n,:)))
legend(['t=' num2str(n)],'location','southeast');
end

Best Answer

for n=linspace(1,length(t),10)
plot(x/L,(c(n,:)))
legend(['t=' , num2str(n)],'Location','southeast');
end
% Use comma before num2str and Location L is caps lock.