Dear colleagues,
how can I plot data from a matrix and have the legend entries in it automatically, too?
To make my question easier to understand I attached a code snippet:
1) What works:
Matrix = [a, A_2, 0];%% Plot
figurehold onfor i=1:size(Matrix,1) plot([0,Matrix(i,1)],[Matrix(i,2),Matrix(i,3)])end
2) Waht I want to have:
Matrix = [a, A_2, 0, 'legend entry'];%% Plotfigurehold onfor i=1:size(Matrix,1) plot([0,Matrix(i,1)],[Matrix(i,2),Matrix(i,3)]) legend(Matrix(i,4))end
Can you please give me a hint?
Best regards
Felix
Best Answer