m = cell2mat(arrayfun(@(x)v*A.^x,1:n,'UniformOutput',false)')
Test result with loop version
mm = zeros(6,5);
for i = 1:n
mm(i,:) = v*A.^i;
isequal(m,mm) % = 1, same result
Which is faster?
To test speed, I ran 100,000 iterations of the one-liner and the same number of iterations of the for-loop (just the loop, the pre-allocation was done before the timer started). The variable n=20. The median speed of the for-loop was 2.7 times faster than the arrayfun() method (p<0.001 wilcox signed rank test). The for-loop is the clear winner for speed.