%% Powers of Matrix Elements
% Create a 3-by-3 matrix with the same value in each element.

X = -2*ones(3,3)

%
% Compute a 3-by-3 matrix of integer values.

Y = pascal(3)

%
% Compute the element-wise powers of the elements in X corresponding to the exponents defined in Y.

Z = realpow(X,Y)

% Copyright 2012 The MathWorks, Inc.