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

  • Context: MATLAB 
  • Thread starter Thread starter kreil
  • Start date Start date
  • Tags Tags
    Error Matlab
Click For Summary

Discussion Overview

The discussion revolves around common error messages encountered in MATLAB, specifically focusing on the message regarding function handles. Participants share experiences and insights related to this error, including potential causes and contexts in which it arises.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification

Main Points Raised

  • Some participants highlight the error message "FUN must be a function, a valid string expression, or an inline function object," noting that it occurs when a function handle is not specified correctly.
  • One participant provides context about the transition from inline function objects to function handles, indicating that this is a relevant aspect of the error's background.
  • A participant mentions an example involving the FMINSEARCH function to illustrate how the error can arise and suggests a link for further details.

Areas of Agreement / Disagreement

Participants generally agree on the nature of the error message and its implications, but there is no consensus on all potential causes or solutions, as the discussion remains open for additional contributions.

Contextual Notes

The discussion does not fully explore all assumptions related to function handles or the specific contexts in which the error may occur, leaving some aspects unresolved.

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   Reactions: 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
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K