Hi I am trying to use fminsearch and i keep getting the following error:Attempt to execute SCRIPT fminsearch as a function, any idea?

 채택된 답변

Star Strider
Star Strider 2016년 7월 12일

2 개 추천

You have a script somewhere named ‘fminsearch’. This is called ‘overshadowing’ of built-in MATLAB functions, and should be avoided.
Run this line:
q = which('fminsearch', '-all')
It should only return these two lines (or something similar for your system):
q =
'C:\Program Files\MATLAB\R2016a\toolbox\matlab\optimfun\fminsearch.p'
'C:\Program Files\MATLAB\R2016a\toolbox\matlab\optimfun\fminsearch.m'
The solution is to rename your script file.

댓글 수: 2

Nikos P
Nikos P 2016년 7월 12일
thank you very much!
Star Strider
Star Strider 2016년 7월 12일
My pleasure!
If my Answer solved your problem, please Accept it.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2016년 7월 12일

댓글:

2016년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by