In MATLAB, how to use a loop to create a legend?
One can create a MATLAB legend with a loop thanks to the following script:
N = 5;
Legend=cell(N,1);
for i=1:N
Legend{i} = sprintf('Text %d', i);
end
legend(Legend);
The above code should display something like:
One can create a MATLAB legend with a loop thanks to the following script:
N = 5;
Legend=cell(N,1);
for i=1:N
Legend{i} = sprintf('Text %d', i);
end
legend(Legend);
The above code should display something like:
One can create a MATLAB legend with a loop thanks to the following script:
N = 5;
Legend=cell(N,1);
for i=1:N
Legend{i} = sprintf('Text %d', i);
end
legend(Legend);
The above code should display something like:
One can create a MATLAB legend with a loop with the following code:
N = 5;
Legend=cell(N,1);
for i=1:N
Legend{i} = sprintf('Text %d', i);
end
legend(Legend);
The above code should display something like:
# | ID | Query | URL | Count |
---|---|---|---|---|
0 | 12184 | en | https://en.ans.wiki/6826/in-matlab-how-to-use-a-loop-to-create-a-legend | 8 |