Why my plot is not working in loop for different graph representations? [duplicate]
问题 This question already has an answer here : Plot several lines (looping through line styles in cell array) in Matlab (1 answer) Closed 2 years ago . I have a matrix 'capacity' and I want to plot its row and for that I have used a loop, my code is for j_1=1:8 plotStyle = {'k -','r +','g *','b.','y o','r--','b d','g s'}; hold on; plot(x_1,capacity(j_1,:),plotStyle(j_1)); end hold off; x_1 is just the x axis, the number of elements in x_1 is equal to the number of columns of capacity.But I am