I am trying to build a cell array of strings that can be used as legend text in a plot. A simplified version of what I am trying to do is as follows:
legends = '';legends = 'this';legends = {legends; 'this other one'};legends = {legends; 'this here one here'};legends = {legends; 'and this other one'};legend(legends, 'Location', 'SouthOutside');
However, I receive the following error on the legend command:
Cell array argument must be a cell array of strings.
I thought {} were used to generate a cell array of strings. Why is this not working?
Best Answer