How can I limit maximum value of yy axis of the gaplot fcn?

1 回表示 (過去 30 日間)
Vitor Ribeiro
Vitor Ribeiro 2014 年 9 月 12 日
回答済み: Alan Weiss 2014 年 9 月 12 日
Hi. In association with my previous posts, I am trying to plot the results of best individuals so I can see how is working ga in my optimization problem.
About my problem, I have ga evaluating many solutions that I consider invalid through ff. Each invalid solution are not really evaluated and the fval of each one is set by a random number between 1000 and 2000. With this ga, after randomly finding a valid solution with fval rounding between 10 and 100, will prefer to converge to solutions close to the valid ones.
The problem is: I just want to see in plotted results the valid solutions. So I just want to set yy' axis limit of @gaplotbestf to 100.
In fact, I do not have permission for that. I need an alternative so I'm asking your help for this probably simple question.
Any doubt that arise due to my embarassing english, just say it! I'll try to explain to you.
Best regards. Vitor Ribeiro.

採用された回答

Alan Weiss
Alan Weiss 2014 年 9 月 12 日
While you cannot do this so easily while the optimization is running, you can call
ylim([10,100])
at the end of the optimization and view the plot in the range you prefer.
With more effort, you can write a custom plot function to do whatever you want.
Alan Weiss
MATLAB mathematical toolbox documentation

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by