MATLAB 5 Common MATLAB Error Messages and How to Fix Them - Comments

  • Thread starter Thread starter kreil
  • Start date Start date
  • Tags Tags
    Error Matlab
AI Thread Summary
The discussion centers around a new PF Insights post detailing five common MATLAB error messages and their solutions. A key focus is on the error message indicating that "FUN must be a function, a valid string expression, or an inline function object." This error typically occurs when a function handle is not specified correctly in functions that require it, such as FMINSEARCH. The conversation encourages members to contribute additional error messages they frequently encounter, emphasizing the importance of understanding function handles, which have replaced inline function objects in MATLAB. A link to a relevant MathWorks thread is provided for further clarification on resolving this specific error.
kreil
Science Advisor
Insights Author
Messages
665
Reaction score
68
kreil submitted a new PF Insights post

5 Common MATLAB Error Messages and How to Fix Them

matlaberrors-80x80.png


Continue reading the Original PF Insights Post.
 
  • Like
Likes happyprimate, scottdave and Greg Bernhardt
Physics news on Phys.org
Great resource! Members feel free to add your own error messages you come across often!
 
FUN must be a function, a valid string expression, or an inline function object.
 
SivaChinna said:
FUN must be a function, a valid string expression, or an inline function object.

Good one! This message is returned by some functions that accept a function handle as an input if you don't specify it correctly.

(You might recall that function handles are the current standard, and they replaced inline function objects several years ago)

Here is an example of a way this message can arise using FMINSEARCH and how to fix it:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/166230
 
Back
Top