I plotted 5 graphs with a loop in MATLAB. Now, I want to add a further line only to the third plot. However, when I try to do it, it adds the additional line to every subplot.
What I have is this:
lines = rand([30 5])
line2 = rand([30 1])
for j = 1:k
subplot(3, 2, j);
plot(lines(:,j), 'LineWidth',1,'Color', [0 0 0.5]);
plot(line2, 'LineWidth',1,'Color', [0 0 0.5], 'LineStyle','b--o')
Can anyone help me out?