# str2func

Returns a function handle from a string.

## Syntax

* func\_handle = str2func(str)

## Input argument

* str - a string

## Output argument

* func\_handle - a function handle.

## Description

**function\_handle = str2func(str)** returns a function handle **function\_handle** for the function named in the string **str**

**str** function name or representation of anonymous function.

## Examples

```matlab
fh = str2func('cos')
str = func2str(fh)
```

```matlab
myFind = str2func('@(x, y) find(x > y)')
M = rand(4, 3, 5);
[R, C] = myFind(M, 0.9)
```

## See also

[func2str](func2str), [isfunction\_handle](isfunction_handle).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
