# PetscMatlabEngineEvaluate
Evaluates a string in MATLAB 
## Synopsis
```
#include "petscmatlab.h"  
PetscErrorCode PetscMatlabEngineEvaluate(PetscMatlabEngine mengine, const char string[], ...)
```
Not Collective


## Input Parameters

- ***mengine -*** the MATLAB engine
- ***string -*** format as in a printf()



## Notes
Run the PETSc program with -info to always have printed back MATLAB's response to the string evaluation

If the string utilizes a MATLAB script that needs to run in the engine, the script must be available via MATLABPATH on that machine.




## See Also
 `PetscMatlabEngineDestroy()`, `PetscMatlabEnginePut()`, `PetscMatlabEngineGet()`,
`PetscMatlabEngineCreate()`, `PetscMatlabEngineGetOutput()`, `PetscMatlabEnginePrintOutput()`,
`PETSC_MATLAB_ENGINE_()`, `PetscMatlabEnginePutArray()`, `PetscMatlabEngineGetArray()`, `PetscMatlabEngine`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/matlabengine/matlab.c.html#PetscMatlabEngineEvaluate">src/sys/classes/matlabengine/matlab.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex31.c.html">src/vec/vec/tutorials/ex31.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex5.c.html">src/snes/tutorials/ex5.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex55.c.html">src/snes/tutorials/ex55.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/matlabengine/matlab.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
