From: Bruno Luong on
Here is the "Conv" way:

a = 0.9;

P=1;
for k=1:10
P = conv(P,[1 -a^k]);
end
disp(P)

% Bruno
From: Walter Roberson on
Julian Geiger wrote:
> Great, thx. Is there a way to order the result according to coefficients
> of x^k?
> (example: x*(-a^3 - a^5) + x^2*(a^5 + a^6) ...)

In Maple, the call would be named collect(); the MuPad name is probably fairly
similar.

Note: in Maple, sometimes the coefficients corresponding to x^0 occur at the
beginning and sometimes they occur at the end.

If you want to find the coefficients of a particular power of x, see coeff()
From: Bruno Luong on
I have simplified the Vandermond method to a single line code:

a=0.9;
k = 10;
u=a.^(1:k);

% Engine
P=[1; vander(u)\(u(:).^k)]

% Bruno