Main Content

read

(Not recommended) Read MuPAD program file into symbolic engine

read(symengine,...) is not recommended. Use equivalent Symbolic Math Toolbox™ functions that replace MuPAD® functions instead. For more information, see Compatibility Considerations.

Description

read(symengine,filename) reads the MuPAD program file filename into the symbolic engine. Reading a program file means finding and executing it.

Examples

Read MuPAD Program File into Symbolic Engine

Suppose you wrote the MuPAD procedure myProc and saved it in the file myProcedure.mu.

Before you can call this procedure at the MATLAB® Command Window, you must read the file myProcedure.mu into the symbolic engine. To read a program file into the symbolic engine, use read:

read(symengine, 'myProcedure.mu')

If the file is not on the MATLAB path, specify the full path to this file. For example, if myProcedure.mu is in the MuPAD folder on disk C, enter:

read(symengine, 'C:/MuPAD/myProcedure.mu')

Now you can access the procedure myProc using evalin or feval. For example, compute the factorial of 10:

feval(symengine, 'myProc', 10)
ans =
3628800

Input Arguments

collapse all

Name of a MuPAD program file, specified as a character vector. This file must have the extension .mu or .gz.

Tips

  • If you do not specify the file extension, read searches for the file filename.mu.

  • If filename is a GNU® zip file with the extension .gz, read uncompresses it upon reading.

  • filename can include full or relative path information. If filename does not have a path component, read uses the MATLAB function which to search for the file on the MATLAB path.

  • read ignores any MuPAD aliases defined in the program file. If your program file contains aliases or uses the aliases predefined by MATLAB, see Alternatives.

Alternatives

You also can use feval to call the MuPAD read function. The read function available from the MATLAB Command Window is equivalent to calling the MuPAD read function with the Plain option. It ignores any MuPAD aliases defined in the program file:

feval(symengine, 'read',' "myProcedure.mu" ', 'Plain')

If your program file contains aliases or uses the aliases predefined by MATLAB, do not use Plain:

feval(symengine, 'read',' "myProcedure.mu" ')

Version History

Introduced in R2011b

expand all