I have two vectors, X of bases and N of exponents. I want to get the matrix of all values e = xn for each x in
X
N
e = xn
x
This is probably a bit sloppier than the bsxfun answer, but you could use meshgrid:
bsxfun
meshgrid
E = X.^(meshgrid(N)')
This assumes both X and N are row vectors. If both are column vectors then it becomes:
E = X.^(meshgrid(N))