how to add a new entry for legend while running a multiple plot
Afficher commentaires plus anciens
% Timeseries Simulation
clear all;
clc
tic
x=1:10;
Sol=zeros(Nhr,6);
for i=1:3
y=i.*x;
figure (1), fig1 = plot(x,y);
legend(['plot for run ',num2str(i)])
hold on
end
Réponses (1)
Cameron B
le 21 Jan 2020
x=1:10;
hold on
for ii=1:3
y=ii.*x;
fig1 = plot(x,y);
legvec{ii} = sprintf('plot for run %d',ii);
end
legend(legvec,'Location','northwest')
hold off
1 commentaire
AKHILESH BARNWAL
le 28 Jan 2020
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!