Pattern Search Stopping Criteria

조회 수: 2 (최근 30일)
MSA
MSA 2021년 8월 10일
댓글: MSA 2021년 8월 11일
Hi
I have been trying to implement a way to stop the pattern search algorithm, if it reaches a specific function value (or r^2 value in our case). It seems like you can't put 'break' inside the function to stop it with specified values.
Is there any particular fucntions that we can use as a stopping function?
Thanks a lot.

채택된 답변

Sean de Wolski
Sean de Wolski 2021년 8월 10일
You can use an outputfcn for this. The output function can pass back a stop flag.
  댓글 수: 1
MSA
MSA 2021년 8월 11일
I was able to stop using the outputfcn. Thanks for your answer and help.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 8월 10일
Hard to say with out seeing the code. You can put a break inside a for loop or a while loop and it will go to the line right after the end of that loop with all the values having whatever value they had last.
If you just want to exit the entire function immediately, you can use "return" instead of break.
Post your code if you want more help.
  댓글 수: 3
Image Analyst
Image Analyst 2021년 8월 11일
편집: Image Analyst 2021년 8월 11일
Sorry, when you said "pattern search algorithm", I thought you had your own pattern search function you had written. I didn't know that you were referring to the patternsearch() function that is built in to the Global Optimization Toolbox.
I'll remove the space from the tag, and add the Toolbox to the product list to make it more clear.
MSA
MSA 2021년 8월 11일
I am sorry for making it confusing.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Direct Search에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by