Reputation: 2048
How can I write this is one command in Matlab (or without loop)
X=A;
for i =1:d-1
X= cat(3, X, A);
end
I tried to use permute, and then repmat, but the singleton last dimension is eliminated automatically, so that does not help.
Upvotes: 0
Views: 55
Reputation: 455
Use the repmat function (see repmat doc)
X = repmat(A, [size(A), d])
Upvotes: 1