Q:

Can't understand some array syntax

I found a MATLAB code like this one:
x = [1, ([1:(m-1)].^a)];

where a and m are scalar.
Could somebody explain that? I'm not so familiar with the MATLAB programming language.

A:

1:(m-1) creates and array from 1 to m-1 in steps of 1.
.^a raises each element in the previous array to the power a (^ is a regular power and tries to compute the matrix power, the . makes operations element-wise, i.e. raise each element to power a instead of the whole matrix)
[1, y] is simply the array y with a 1 prepended as first element.

Putting this all together we find that x is an array which starts with 1, followed by an integer array 1:(m-1) with each element raised to the power a.
m=5;a=3;
x = [1, ([1:(m-1)].^a)]
x =
     1     1     8    27    64

Broken down in steps:
tmp = 1:(m-1)
tmp =
     1     2     3     4
tmp2 = tmp.^a
ans =
     1     8    27    64
x = [1 tmp2]
x =
     1     1     8    27    64

