I want to create multidimensional arrays that repeat a vector along along the other dimensions. E.g. for row-vectors a and b I can create A which has A(:,n,m,k)=a for all n,m,k and similarly B which has B(n,:,m,k) for all n,m,k as follows:
A=repmat(a', [1 length(b) length(c) length(d)]); B=repmat(b, [length(a) 1 length(c) length(d)]);
How can I do the equivalent for C and D? I.e. such that C(n,m,:,k)=c where c is a row vector.