I'm trying to do the following:
Let's say I have:
x1=[7];
x2=[3 4];
x3=[1 -1 5];
x4=[2 5 -1 3];
and I want to add them together.
I know it's not possible to add vectors of different dimensions, but what I'm trying to achieve is a new vector having:
v=[2 5+1 -1-1+3 3+5+4+7];
I tried to pad the relevant vectors with zeros, to get:
x1=[0 0 0 7];
x2=[0 0 3 4];
x3=[0 1 -1 5];
x4=[2 5 -1 3];
and then the addition will be natural, but couldn't find a way to do it.
Of course, I'm looking for an iterative method of doing that, meaning, every vector xi is the result of the i'th iteration, where the number of iterations, n, is known in advance. (in the above example n=4)