www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SquareRootOfVectorElementsExample.m

    %% Square Root of Vector Elements
% Create a row vector containing both negative and positive values.
X = -2:2

%%
% Compute the square root of each element of |X|.
Y = sqrt(X)