FUNCTION REFERENCE

sqrt

Square root.

Square root.

Syntax

sqrt(X)

Applies the square root to each element.

Negative real input and complex input give the principal complex root.

Example

sqrt(16)   % 4

Example

sqrt(-4)   % 0 + 2i

Differences from MATLAB: double, logical and char 2-D arrays only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.