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 CenterFile Exchange에서 Solver 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