Getting Started Previous page   Next Page

The eval Function

The eval function works with text variables to implement a powerful text macro facility. The expression or statement

uses the MATLAB interpreter to evaluate the expression or execute the statement contained in the text string s.

The example of the previous section could also be done with the following code, although this would be somewhat less efficient because it involves the full interpreter, not just a function call.


Previous page  Passing String Arguments to Functions Function Handles Next page

© 1994-2005 The MathWorks, Inc.