[sol]=aaa(@ptch);
[x1,x2]=ptch(sol)
plot(x1,x2,'r.-');hold on;
xlabel('x1');ylabel('x2')
legend('Modified');
pause('on')
fprintf('Press any key to continue to other algorithm')
pause
[Sol]=bbb(@ptch);
[x1 x2]=ptch(Sol)
plot(x1,x2,'k.-'); hold on;
xlabel('x1');ylabel('x2')
legend('pre modified');
toc
how to display the legend in such a case?

6 commentaires

Azzi Abdelmalek
Azzi Abdelmalek le 30 Avr 2016
What case?
JL555
JL555 le 30 Avr 2016
Modifié(e) : JL555 le 30 Avr 2016
That coding i posted...because only one legend comes and not 2
Walter Roberson
Walter Roberson le 30 Avr 2016
You legend once for every iteration of your for loops. You need 42 legend entries.
JL555
JL555 le 30 Avr 2016
Modifié(e) : JL555 le 30 Avr 2016
My bad let me edit the code
Walter Roberson
Walter Roberson le 30 Avr 2016
Are your x2 vectors or 2 dimensional arrays?
JL555
JL555 le 1 Mai 2016
Modifié(e) : JL555 le 2 Mai 2016
both x1 and x2 is 1x50 double

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 2 Mai 2016

0 votes

Do not call legend() twice. Call it once and pass in both entries.

1 commentaire

JL555
JL555 le 2 Mai 2016
Modifié(e) : JL555 le 2 Mai 2016
yes walter i figured it out...by the way thanks anyway do you have any idea on pareto frontier for 2 objective functions?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by