I have the following code, producing 10 different lines in one graph. Each of these lines correspond to a certain variance of a, for which I want to create a legend.
With the current code, the legend just states "data1, data2,data3 etc" for each line.
I want the values of the array variance_a, which I produce outside of the for loop, to match data 1, data2,data3 etc and to add the text "variance_a=" in front of the value. In short, I want the legend to look like this:
variance_a= (first output of variance_a array)
variance_a=(second output of variance_a array)
I can't seem to figure out how to call values out of the array to the legend, and I want to avoid having to enter each input bij hand, as the number of values in variance_a needs to be changed. Any help here?
s = -1 + (2).*rand(sample,1);
s = nonzeros(s);