SQRT Square Root of an Array

Section: Mathematical Functions

Usage

Computes the square root of the argument matrix. The general syntax for its use is
   y = sqrt(x)

where x is an N-dimensional numerical array.

Example

Here are some examples of using sqrt
--> sqrt(9)

ans = 

 3 

--> sqrt(i)

ans = 

    0.7071 +  0.7071i 

--> sqrt(-1)

ans = 

    0.0000 +  1.0000i 

--> x = rand(4)

x = 

    0.4066    0.0875    0.0159    0.7965 
    0.5578    0.7149    0.6533    0.8631 
    0.7577    0.6803    0.8580    0.7706 
    0.9184    0.5500    0.4416    0.9193 

--> sqrt(x)

ans = 

    0.6377    0.2958    0.1262    0.8925 
    0.7469    0.8455    0.8083    0.9290 
    0.8704    0.8248    0.9263    0.8778 
    0.9583    0.7416    0.6645    0.9588