Main Content

vectorize

(Not recommended) Vectorize expression

vectorize is not recommended.

Description

example

cdot = vectorize(c), where c is a character row vector or string scalar, inserts a . before any ^, *, or / in c. The result is a character row vector.

If c is an inline function object, then vectorize adds . to the function.

For information on vectorization in MATLAB®, see Vectorization.

Examples

Add Vector Operation

Create a string array that squares a variable, and change it to a vector operation.

c = "t^2"

c = 

    "t^2"
cdot = vectorize(c)

cdot =

    't.^2'

Input Arguments

collapse all

Input, specified as a character vector, string scalar, or inline function object.

Version History

Introduced before R2006a

See Also