Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Programming Utilities

Execute expressions or functions, determine dependencies, protect source code

Functions

echo Display statements during function execution
eval Execute MATLAB expression in text
evalc Evaluate MATLAB expression with capture
evalin Execute MATLAB expression in specified workspace
feval Evaluate function
run Run MATLAB script
builtin Execute built-in function from overloaded method
matlab.codetools.requiredFilesAndProducts List dependencies of MATLAB program files
mfilename File name of currently running code
pcode Create protected function file
timer Create object to schedule execution of MATLAB commands

Examples and How To

Identify Program Dependencies

Determine which functions and scripts your program is dependent upon.

Protect Your Source Code

When you share your MATLAB® code, the contents are easily accessed, revealing design and implementation details. You can obfuscate or compile your source files.

Use a MATLAB Timer Object

To schedule the execution of MATLAB commands, create a timer object.

Create Hyperlinks that Run Functions

Functions that support the matlab: keyword can display hyperlinks, which execute commands when you click the hyperlink text.

Concepts

Alternatives to the eval Function

Although the eval function is very powerful and flexible, it is not always the best solution to a programming problem. In many instances, there are recommended alternative approaches to using eval.

Timer Callback Functions

Use a callback function to specify commands to execute during timer object events. Timer object events include when a timer starts, fires, stops, or encounters an error.

Handling Timer Queuing Conflicts

At busy times, in multiple-execution scenarios, the timer might need to add the timer callback function to the execution queue before the previously queued callback function completes. You can define how the timer handles this scenario by setting the BusyMode property.

Was this topic helpful?